fips.base.Structure2D#
- class fips.base.Structure2D(data, name=None, index=None, columns=None, dtype=None, copy=None, sparse=False)[source]#
Bases:
StructureBase class for 2D structures (Matrix).
- Parameters:
data (np.ndarray) – 2D data.
name (str, optional) – Name for the Structure.
index (pd.Index) – Index for the rows of the DataFrame.
columns (pd.Index, optional) – Index for the columns of the DataFrame. If None, uses the same as index.
dtype (data type, optional) – Data type to force.
copy (bool, optional) – Whether to copy the data.
sparse (bool, default False) – If True, store the data in pandas sparse format (fill_value=0.0). The caller is responsible for zeroing out near-zero values before setting sparse=True (e.g. via a threshold in the builder).
Attributes
Return the columns of the underlying DataFrame. |
|
The underlying data, which must be numeric and non-NaN. |
|
True if the internal DataFrame uses pandas sparse storage. |
|
Name of the structure, used for error messages and block naming. |
|
Return values as numpy array or sparse matrix. |
Methods
|
Return a copy with dense internal storage. |
|
Get the underlying DataFrame data. |
|
Return a copy with sparse internal storage. |
Inherited
From Structure: copy, index, reindex, round_index, shape, to_numpy, xs
From Pickleable: from_file, to_file