Series¶

All supported Series APIs

Constructor

Series([data, index, dtype, name, copy, ...])

Snowpark pandas representation of pandas.Series with a lazily-evaluated relational dataset.

Attributes

Series.index

Get the index for this DataFrame.

Series.axes

Return a list of the row axis labels.

Series.array

Return the ExtensionArray of the data backing this Series or Index.

Series.dtype

Return the dtype object of the underlying data.

Series.dtypes

Return the dtype object of the underlying data.

Series.duplicated([keep])

Indicate duplicate Series values.

Series.empty

Indicator whether the Series is empty.

Series.hasnans

Return True if there are any NaNs.

Series.name

Return the name of the Series.

Series.ndim

Number of dimensions of the underlying data, by definition 1.

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.T

Return the transpose, which is by definition self.

Series.values

Return a NumPy representation of the dataset.

Snowflake Specific

Series.to_snowflake(name[, if_exists, ...])

Save the Snowpark pandas Series as a Snowflake table.

Series.to_snowpark([index, index_label])

Convert the Snowpark pandas Series to a Snowpark DataFrame.

Series.cache_result([inplace])

Persists the current Snowpark pandas Series to a temporary table to improve the latency of subsequent operations.

Conversion

Series.astype(dtype[, copy, errors])

Cast a pandas object to a specified dtype dtype.

Series.convert_dtypes([infer_objects, ...])

Convert columns to best possible dtypes using dtypes supporting pd.NA.

Series.copy([deep])

Make a copy of this object's indices and data.

Series.to_dict([into])

Convert Series to {label -> value} dict or dict-like object.

Series.to_list()

Return a list of the values.

Series.to_numpy([dtype, copy, na_value])

A NumPy ndarray representing the values in this Series or Index.

Series.to_pandas(*[, statement_params])

Convert Snowpark pandas Series to pandas.Series

Series.__array__([dtype])

Return the values as a NumPy array.

Indexing, iteration

Series.iloc

Purely integer-location based indexing for selection by position.

Series.loc

Access a group of rows and columns by label(s) or a boolean array.

Series.__iter__()

Return an iterator of the values.

Series.keys()

Return alias for index.

Binary operator functions

Series.add(other[, level, fill_value, axis])

Return Addition of series and other, element-wise (binary operator add).

Series.sub(other[, level, fill_value, axis])

Return Subtraction of series and other, element-wise (binary operator sub).

Series.mul(other[, level, fill_value, axis])

Return Multiplication of series and other, element-wise (binary operator mul).

Series.div(other[, level, fill_value, axis])

Return Floating division of series and other, element-wise (binary operator truediv).

Series.truediv(other[, level, fill_value, axis])

Return Floating division of series and other, element-wise (binary operator truediv).

Series.floordiv(other[, level, fill_value, axis])

Return Integer division of series and other, element-wise (binary operator floordiv).

Series.mod(other[, level, fill_value, axis])

Return Modulo of series and other, element-wise (binary operator mod).

Series.pow(other[, level, fill_value, axis])

Return Exponential power of series and other, element-wise (binary operator pow).

Series.radd(other[, level, fill_value, axis])

Return Addition of series and other, element-wise (binary operator radd).

Series.rsub(other[, level, fill_value, axis])

Return Subtraction of series and other, element-wise (binary operator rsub).

Series.rmul(other[, level, fill_value, axis])

Return Multiplication of series and other, element-wise (binary operator rmul).

Series.rdiv(other[, level, fill_value, axis])

Return Floating division of series and other, element-wise (binary operator rtruediv).

Series.rtruediv(other[, level, fill_value, axis])

Return Floating division of series and other, element-wise (binary operator rtruediv).

Series.rfloordiv(other[, level, fill_value, ...])

Return Integer division of series and other, element-wise (binary operator rfloordiv).

Series.rmod(other[, level, fill_value, axis])

Return Modulo of series and other, element-wise (binary operator rmod).

Series.rpow(other[, level, fill_value, axis])

Return Exponential power of series and other, element-wise (binary operator rpow).

Series.round([decimals])

Round each value in a Series to the given number of decimals.

Series.lt(other[, level, fill_value, axis])

Return Less than of series and other, element-wise (binary operator lt).

Series.gt(other[, level, fill_value, axis])

Return Greater than of series and other, element-wise (binary operator gt).

Series.le(other[, level, fill_value, axis])

Return Less than or equal to of series and other, element-wise (binary operator le).

Series.ge(other[, level, fill_value, axis])

Return Greater than or equal to of series and other, element-wise (binary operator ge).

Series.ne(other[, level, fill_value, axis])

Return Not equal to of series and other, element-wise (binary operator ne).

Series.eq(other[, level, fill_value, axis])

Return Equal to of series and other, element-wise (binary operator eq).

Function application, GroupBy & window

Series.apply(func[, convert_dtype, args])

Invoke function on values of Series.

Series.agg([func, axis])

Aggregate using one or more operations over the specified axis.

Series.aggregate([func, axis])

Aggregate using one or more operations over the specified axis.

Series.transform(func[, axis])

Call func on self producing a BasePandasDataset with the same axis shape as self.

Series.map(arg[, na_action])

Map values of Series according to an input mapping or function.

Series.groupby([by, axis, level, as_index, ...])

Group Series using a mapper or by a Series of columns.

Series.rolling(window[, min_periods, ...])

Provide rolling window calculations.

Computations / descriptive stats

Series.abs()

Return a Series with absolute numeric value of each element.

Series.all([axis, bool_only, skipna])

Return whether all elements are True, potentially over an axis.

Series.any([axis, bool_only, skipna])

Return whether any element are True, potentially over an axis.

Series.count()

Return number of non-NA/null observations in the Series.

Series.cummax([axis, skipna])

Return cumulative maximum over a BasePandasDataset axis.

Series.cummin([axis, skipna])

Return cumulative minimum over a BasePandasDataset axis.

Series.cumsum([axis, skipna])

Return cumulative sum over a BasePandasDataset axis.

Series.describe([percentiles, include, exclude])

Generate descriptive statistics.

Series.diff([periods])

First discrete difference of element.

Series.max([axis, skipna, numeric_only])

Return the maximum of the values over the requested axis.

Series.mean([axis, skipna, numeric_only])

Return the mean of the values over the requested axis.

Series.median([axis, skipna, numeric_only])

Return the median of the values over the requested axis.

Series.min([axis, skipna, numeric_only])

Return the minimum of the values over the requested axis.

Series.quantile([q, interpolation])

Return value at the given quantile.

Series.rank([axis, method, numeric_only, ...])

Compute numerical data ranks (1 through n) along axis.

Series.skew([axis, skipna, numeric_only])

Return unbiased skew, normalized over n-1

Series.std([axis, skipna, ddof, numeric_only])

Return sample standard deviation over requested axis.

Series.sum([axis, skipna, numeric_only, ...])

Return the sum of the values over the requested axis.

Series.var([axis, skipna, ddof, numeric_only])

Return unbiased variance over requested axis.

Series.unique()

Return unique values of Series object.

Series.nunique([dropna])

Return number of unique elements in the series.

Series.is_unique

Return True if values in the Series are unique.

Series.value_counts([normalize, sort, ...])

Return a Series containing counts of unique values.

Reindexing / selection / label manipulation

Series.drop([labels, axis, index, columns, ...])

Return Series with specified index labels removed.

Series.drop_duplicates([keep, inplace])

Return Series with duplicate values removed.

Series.get(key[, default])

Get item from object for given key (ex: DataFrame column).

Series.head([n])

Return the first n rows.

Series.idxmax([axis, skipna])

Return the row label of the maximum value.

Series.idxmin([axis, skipna])

Return the row label of the minimum value.

Series.isin(values)

Whether elements in Series are contained in values.

Series.last(offset)

Select final periods of time series data based on a date offset.

Series.rename([index, axis, copy, inplace, ...])

Alter Series index labels or name.

Series.rename_axis([mapper, index, axis, ...])

Set the name of the axis for the index or columns.

Series.reset_index([level, drop, name, ...])

Generate a new DataFrame or Series with the index reset.

Series.sample([n, frac, replace, weights, ...])

Return a random sample of items from an axis of object.

Series.set_axis(labels, *[, axis, copy])

Assign desired index to given axis.

Series.take(indices[, axis])

Return the elements in the given positional indices along an axis.

Series.tail([n])

Return the last n rows.

Series.where(cond[, other, inplace, axis, level])

Replace values where the condition is False.

Series.mask(cond[, other, inplace, axis, level])

Replace values where the condition is True.

Series.add_prefix(prefix)

Prefix labels with string prefix.

Series.add_suffix(suffix)

Suffix labels with string suffix.

Missing data handling

Series.dropna(*[, axis, inplace, how])

Return a new Series with missing values removed.

Series.ffill([axis, inplace, limit, downcast])

Synonym for DataFrame.fillna() with method='ffill'.

Series.fillna([value, method, axis, ...])

Fill NA/NaN values using the specified method.

Series.isna()

Detect missing values.

Series.isnull()

Series.isnull is an alias for Series.isna.

Series.notna()

Detect non-missing values for an array-like object.

Series.notnull()

Detect non-missing values for an array-like object.

Series.pad([axis, inplace, limit, downcast])

Synonym for DataFrame.fillna() with method='ffill'.

Series.replace([to_replace, value, inplace, ...])

Replace values given in to_replace with value.

Reshaping, sorting

Series.sort_values([axis, ascending, ...])

Sort by the values.

Series.sort_index([axis, level, ascending, ...])

Sort object by labels (along an axis).

Series.squeeze([axis])

Squeeze 1 dimensional axis objects into scalars.

Combining / comparing / joining / merging

Series.update(other)

Modify Series in place using values from passed Series.

Time Series-related

Series.shift([periods, freq, axis, ...])

Shift data by desired number of periods and replace columns with fill_value (default: None).

Series.first_valid_index()

Return index for first non-NA value or None, if no non-NA value is found.

Series.last_valid_index()

Return index for last non-NA value or None, if no non-NA value is found.

Series.resample(rule[, axis, closed, label, ...])

Resample time-series data.

Accessors

Series.str

Vectorized string functions for Series and Index.

Series.dt

Accessor object for datetimelike properties of the Series values.

All supported Series str APIs

All supported Series dt APIs