modlee.dataframes module
- class modlee.dataframes.DataFrameTransforms[source]
Bases:
object
Transforms for a dataframe. Inspired by torchvision’s transforms.
- class modlee.dataframes.ModleeDataFrame(data=None, index: Collection[Any] | None = None, columns: Collection[Any] | None = None, dtype: ExtensionDtype | str | dtype | Type[str | float | int | complex | bool | object] | None = None, copy: bool | None = None)[source]
Bases:
DataFrame
A wrapper class over a pandas DataFrame with convenience functions for metafeatures.
- to_tsv(*args, **kwargs)[source]
Save a dataframe to a tab-separated value file. Wraps around and passes arguments to pd.DataFrame.to_csv().
- to_txt(path, columns=None, apply_fn=None, *args, **kwargs)[source]
Save a column of a dataframe
- Parameters:
path – The path to save the txt to.
columns – The columns of the dataframe to save, defaults to None
apply_fn – An optional function to apply to the dataframe (i.e. pd.DataFrame.apply(apply_fn)), defaults to None
- modlee.dataframes.default_transforms(df)