Series

Constructor

Series([data, index, dtype, name, copy, …]) Koala Series that corresponds to Pandas Series logically.

Attributes

Series.index The index (axis labels) Column of the Series.
Series.dtype Return the dtype object of the underlying data.
Series.dtypes Return the dtype object of the underlying data.
Series.name Return name of the Series.
Series.schema Return the underlying Spark DataFrame’s schema.
Series.shape Return a tuple of the shape of the underlying data.
Series.size Return an int representing the number of elements in this object.
Series.empty Returns true if the current object is empty.

Conversion

Series.astype(self, dtype) Cast a Koalas object to a specified dtype dtype.

Indexing, iteration

Series.loc Access a group of rows and columns by label(s) or a boolean Series.
Series.iloc Purely integer-location based indexing for selection by position.

Binary operator functions

Series.add(self, other) Return Addition of series and other, element-wise (binary operator +).
Series.div(self, other) Return Floating division of series and other, element-wise (binary operator /).
Series.divide(self, other) Return Floating division of series and other, element-wise (binary operator /).
Series.mul(self, other) Return Multiplication of series and other, element-wise (binary operator *).
Series.multiply(self, other) Return Multiplication of series and other, element-wise (binary operator *).
Series.radd(self, other) Return Addition of series and other, element-wise (binary operator +).
Series.rdiv(self, other) Return Floating division of series and other, element-wise (binary operator /).
Series.rmul(self, other) Return Multiplication of series and other, element-wise (binary operator *).
Series.rsub(self, other) Return Subtraction of series and other, element-wise (binary operator -).
Series.rtruediv(self, other) Return Floating division of series and other, element-wise (binary operator /).
Series.sub(self, other) Return Subtraction of series and other, element-wise (binary operator -).
Series.subtract(self, other) Return Subtraction of series and other, element-wise (binary operator -).
Series.truediv(self, other) Return Floating division of series and other, element-wise (binary operator /).

Function application, GroupBy & Window

Series.apply(self, func[, args]) Invoke function on values of Series.
Series.map(self, arg) Map values of Series according to input correspondence.
Series.groupby(self, by) Group DataFrame or Series using a Series of columns.
Series.pipe(self, func, \*args, \*\*kwargs) Apply func(self, *args, **kwargs).

Computations / Descriptive Stats

Series.abs(self) Return a Series/DataFrame with absolute numeric value of each element.
Series.all(self, axis, str]=0) Return whether all elements are True.
Series.any(self, axis, str]=0) Return whether any element is True.
Series.clip(self, lower, int]=None, upper, …) Trim values at input threshold(s).
Series.corr(self, other[, method]) Compute correlation with other Series, excluding missing values.
Series.count(self) Return number of non-NA/null observations in the Series.
Series.describe(self, percentiles, …) Generate descriptive statistics that summarize the central tendency, dispersion and shape of a dataset’s distribution, excluding NaN values.
Series.kurt(self) Return unbiased kurtosis using Fisher’s definition of kurtosis (kurtosis of normal == 0.0).
Series.max(self) Return the maximum of the values.
Series.mean(self) Return the mean of the values.
Series.min(self) Return the minimum of the values.
Series.skew(self) Return unbiased skew normalized by N-1.
Series.std(self) Return sample standard deviation.
Series.sum(self) Return the sum of the values.
Series.var(self) Return unbiased variance.
Series.kurtosis(self) Return unbiased kurtosis using Fisher’s definition of kurtosis (kurtosis of normal == 0.0).
Series.unique(self) Return unique values of Series object.
Series.value_counts(self[, normalize, sort, …]) Return a Series containing counts of unique values.

Reindexing / Selection / Label manipulation

Series.head(self[, n]) Return the first n rows.
Series.isin(self, values) Check whether values are contained in Series.
Series.rename(self[, index]) Alter Series name.
Series.reset_index(self[, level, drop, …]) Generate a new DataFrame or Series with the index reset.
Series.sample(self, n, NoneType]=None, frac, …) Return a random sample of items from an axis of object.

Missing data handling

Series.isna(self) Detect existing (non-missing) values.
Series.isnull(self) Detect existing (non-missing) values.
Series.notna(self) Detect existing (non-missing) values.
Series.notnull(self) Detect existing (non-missing) values.
Series.dropna(self[, axis, inplace]) Return a new Series with missing values removed.
Series.fillna(self[, value, axis, inplace]) Fill NA/NaN values.

Reshaping, sorting, transposing

Series.sort_index(self, axis, level, …) Sort object by labels (along an axis)
Series.sort_values(self, ascending, inplace, …) Sort by the values.

Serialization / IO / Conversion

Series.to_pandas(self) Return a pandas Series.
Series.to_numpy(self) A NumPy ndarray representing the values in this DataFrame or Series.
Series.to_list(self) Return a list of the values.
Series.to_string(self[, buf, na_rep, …]) Render a string representation of the Series.
Series.to_dict(self[, into]) Convert Series to {label -> value} dict or dict-like object.
Series.to_clipboard(self[, excel, sep]) Copy object to the system clipboard.
Series.to_latex(self[, buf, columns, …]) Render an object to a LaTeX tabular environment table.
Series.to_json(self[, path_or_buf, orient, …]) Convert the object to a JSON string.
Series.to_csv(self[, path_or_buf, sep, …]) Write object to a comma-separated values (csv) file.
Series.to_excel(self, excel_writer[, …]) Write object to an Excel sheet.

Datetime Methods

Methods accessible through Series.dt

DatetimeMethods.date Returns a Series of python datetime.date objects (namely, the date part of Timestamps without timezone information).
DatetimeMethods.year The year of the datetime.
DatetimeMethods.month The month of the timestamp as January = 1 December = 12.
DatetimeMethods.week The week ordinal of the year.
DatetimeMethods.weekofyear The week ordinal of the year.
DatetimeMethods.day The days of the datetime.
DatetimeMethods.dayofweek The day of the week with Monday=0, Sunday=6.
DatetimeMethods.weekday The day of the week with Monday=0, Sunday=6.
DatetimeMethods.dayofyear The ordinal day of the year.
DatetimeMethods.hour The hours of the datetime.
DatetimeMethods.minute The minutes of the datetime.
DatetimeMethods.second The seconds of the datetime.
DatetimeMethods.millisecond The milliseconds of the datetime.
DatetimeMethods.microsecond The microseconds of the datetime.
DatetimeMethods.strftime(self, date_format) Convert to a String Series using specified date_format.
Scroll To Top