dhlab.text.dhlab_object

Module Contents

Classes

DhlabObj

DHLAB base class

API

class dhlab.text.dhlab_object.DhlabObj(frame: pandas.DataFrame = pd.DataFrame())

Bases: abc.ABC

DHLAB base class

Provides shared utility methods to DHLAB classes.

Initialization

property size

Return number of rows in dataframe

property loc
make_subset(row_slice, col_slice)

Return a subset of the dataframe

__getitem__(*args, **kwargs)

Return a subset of the dataframe

__repr__() str

Return the string representation of the DhlabObj frame attribute

_repr_html_() Union[str, None]

Return the HTML representation of the DhlabObj frame attribute

__len__()
head(n=5)

Return first n rows

tail(n=5)

Return last n rows

sort(by=None, asc=False)

Sort by column

to_csv(path)

Write to csv

to_excel(path)

Write to excel

from_df(df)

Typecast Pandas DataFrame to dhlab class

classmethod from_csv(path)

Import corpus from csv