typeddfs.matrix_dfs
ο
DataFrames that are essentially n-by-m matrices.
Module Contentsο
- class typeddfs.matrix_dfs.AffinityMatrixDfο
A similarity or distance matrix. The rows and columns must match, and only 1 index is allowed.
- __repr__(self) str ο
- __str__(self) str ο
- classmethod _check(cls, df: typeddfs.base_dfs.BaseDf)ο
- classmethod get_typing(cls) typeddfs.df_typing.DfTyping ο
- classmethod new_df(cls, n: Union[int, Sequence[str]] = 0, fill: Union[int, float, complex] = 0) __qualname__ ο
Returns a DataFrame that is empty but valid.
- Parameters
n β Either a number of rows/columns or a sequence of labels. If a number is given, will choose (str-type) labels β0β, β1β, β¦
fill β A value to fill in every cell. Should match
self.required_dtype
.
- Raises
InvalidDfError β If a function in
verifications
fails (returns False or a string).IntCastingNaNError β If
fill
is NaN or inf andself.required_dtype
does not support it.
- symmetrize(self) __qualname__ ο
Averages with its transpose, forcing it to be symmetric.
- class typeddfs.matrix_dfs.LongFormMatrixDfο
A long-form matrix with columns βrowβ, βcolumnβ, and βvalueβ.
- classmethod get_typing(cls) typeddfs.df_typing.DfTyping ο
- class typeddfs.matrix_dfs.MatrixDfο
A dataframe that is best thought of as a simple matrix. Contains a single index level and a list of columns, with numerical values of a single dtype.
- classmethod get_typing(cls) typeddfs.df_typing.DfTyping ο
- classmethod new_df(cls, rows: Union[int, Sequence[str]] = 0, cols: Union[int, Sequence[str]] = 0, fill: Union[int, float, complex] = 0) __qualname__ ο
Returns a DataFrame that is empty but valid.
- Parameters
rows β Either a number of rows or a sequence of labels. If a number is given, will choose (str-type) labels β0β, β1β, β¦
cols β Either a number of columns or a sequence of labels. If a number is given, will choose (str-type) labels β0β, β1β, β¦
fill β A value to fill in every cell. Should match
self.required_dtype
. String values are
- Raises
InvalidDfError β If a function in
verifications
fails (returns False or a string).IntCastingNaNError β If
fill
is NaN or inf andself.required_dtype
does not support it.