Series Accessor#

General methods and attributes#

cols(s, /[, to_list])

An API to gather name and columns to one.

len(s, /[, number, other])

Return the length of each element in the Series.

getattr(s, name, /, *args, **kwargs)

Return the value of the named attribute of Series element.

Conversion#

change_axis_type(s, dtype[, axis])

Change the type of the axis.

swap_index_values(s, /)

Swap the index and values of the Series.

to_datetime(s, /, **kwargs)

Convert Series to datetime type.

to_zh(s, /, *[, locale, dictionary])

Simple conversion and localization between simplified and traditional Chinese.

to_set(s, /)

Return a set of the values.

values_to_dict(s, /[, unique, to_list, dropna])

Convert index and values to dict.

Binary operator functions#

equal(s, /, other[, align])

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

GroupBy#

groupby_index(s, /, **kwargs)

Group Series by its index.

Computations / Descriptive Stats#

bin(s, /, *args, **kwargs)

Bin values into discrete intervals.

jenks_bin(s, /, bins, **kwargs)

Bin values into discrete intervals via “natural breaks” (Fisher-Jenks algorithm).

jenks_breaks(s, /, bins)

Compute “natural breaks” (Fisher-Jenks algorithm) on Series.

error_report(s, predicted, /[, ...])

Calculate absolute_error and relative_error of two columns.

eval(s, /, expr, **kwargs)

Evaluate a string describing operations on Series.

textdistance(s, /, other[, method, align])

Return a Series containing the text distance to aligned other.

textdistance_matrix(s, /[, other, method])

Returns a DataFrame containing the text distances matrix between in s and other.

top_n(s, /[, n, largest, keep])

Return the top n values.

Reindexing / Selection#

filter_in(s, condition, /[, complement])

Filter Series contents.

invert_or_not(s, /[, invert])

Invert (~) the Series.

query(s, /, expr, **kwargs)

Query the columns of a Series with a boolean expression.

set_unique_index(s, /, **kwargs)

Set unique index via reset_index().

Missing values#

drop_inf(s, /[, inf])

Remove inf values.

drop_not_duplicates(s, /[, keep])

Return duplicate Series values.

dropna_index(s, /[, how])

Return a new Series with missing index removed.

Reshaping / Transposing#

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

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