DataFrame Accessor#

General methods and attributes#

cols(df, /[, to_list])

An API to gather name and columns to one.

Conversion#

change_axis_type(df, dtype[, axis])

Change the type of the axis.

to_series(df, /[, name, index_column, ...])

Convert DataFrame to Series.

to_zh(df, /, column, *[, locale, dictionary])

Simple conversion and localization between simplified and traditional Chinese.

values_to_dict(df, /[, order, ascending, ...])

Convert values to dict.

Binary operator functions#

boolean(df, /[, how, complement])

Return whether any (or all) element is True, potentially over an axis.

equal(df, /, other[, align, axis])

Return a boolean DataFrame containing the result of comparing with other.

GroupBy#

groupby_index(df, /, **kwargs)

Group DataFrame by its index.

Computations / Descriptive Stats#

decompose(df, /, method[, columns, drop])

Decompose DataFrame's columns.

top_n(df, /[, n, largest, keep, prefix, ...])

Returns each row's top n.

repeat(df, repeats, /[, axis])

Repeat row or column of a DataFrame.

weighted_mean(df, /, weights[, validate, ...])

Calculate the weighted score of selected columns in the DataFrame.

Reindexing / Selection#

filter_in(df, condition, /[, how, complement])

Filter DataFrame contents.

set_unique_index(df, /, **kwargs)

Set unique index via reset_index().

Missing values#

drop_inf(df, /[, axis, how, inf, subset])

Remove inf values.

drop_not_duplicates(df, /[, subset, keep])

Return duplicate DataFrame values.

drop_or_not(df, /[, drop])

Drop specified labels from rows or columns.

dropna_index(df, /[, how])

Return a new DataFrame with missing index removed.

fillna_regression(df, /, method, columns[, how])

Fill na value with regression algorithm.

Reshaping / Transposing#

expand(df, /[, suffix, delimiter, flatten])

Transform each element of a list-like to a column.