fcapy.context.BinTable¶
- class fcapy.context.BinTable(data=None)¶
A class to encapsulate the work with binary tables in an efficient way
- all(self, axis=None)¶
Return whether all elements (
axis=0), rows in columns (axis=1), columns in rows (axis=2) are True
- any(self, axis=None)¶
Return whether any element (
axis=0), row in columns (axis=1), column in rows (axis=2) is True
- sum(self, axis=None)¶
Return sum of all elements (
axis=0), rows in columns (axis=1), columns in rows (axis=2)
- arrow_up(self, row_indexes, base_columns=None)¶
Return the maximal set of columns in which all rows (
row_indexes) are True
- arrow_down(self, column_indexes, base_rows=None)¶
Return the maximal set of rows in which all columns (
column_indexes) are True
- __init__(data=None)¶
Initialize the BinTable
- Parameters
data (list of list or bitsets.bases.BitSets) – Data for the BinTable to store
Methods
__init__([data])Initialize the BinTable
all([axis])Check if all rows in columns (``axis``=1), columns in rows (``axis``=2), or both (``axis``=0) are True
any([axis])Check if any element (
axis=0), row in columns (axis=1), column in rows (axis=2) is Truearrow_down(column_indexes[, base_rows])Return the maximal set of rows in which all columns (
column_indexes) are Truearrow_up(row_indexes[, base_columns])Return the maximal set of columns in which all rows (
row_indexes) are Truesum([axis])Return sum of all elements (
axis=0), rows in columns (axis=1), columns in rows (axis=2)to_list()Return BinTable data as a list of list
Attributes
Data for the BinTable to store
Number of rows in the table
Shape of the table
Number of columns in the table
- all(axis=None)¶
Check if all rows in columns (``axis``=1), columns in rows (``axis``=2), or both (``axis``=0) are True
- any(axis=None)¶
Check if any element (
axis=0), row in columns (axis=1), column in rows (axis=2) is True
- arrow_down(column_indexes, base_rows=None)¶
Return the maximal set of rows in which all columns (
column_indexes) are True- Parameters
column_indexes (list of int) – Indexes of columns to process
base_rows (list or int) – List of rows to select ‘’arrowed down’’ rows from. Default value: all the rows.
- Returns
rows
- Return type
list of int
- arrow_up(row_indexes, base_columns=None)¶
Return the maximal set of columns in which all rows (
row_indexes) are True- Parameters
row_indexes (list of int) – Indexes of rows to process
base_columns (list or int) – List of columns to select ‘’arrowed up’’ columns from. Default value: all the columns.
- Returns
columns
- Return type
list of int
- property data¶
Data for the BinTable to store
- property height¶
Number of rows in the table
- property shape¶
Shape of the table
- sum(axis=None)¶
Return sum of all elements (
axis=0), rows in columns (axis=1), columns in rows (axis=2)
- to_list()¶
Return BinTable data as a list of list
- property width¶
Number of columns in the table