bigframes.pandas.Series#

class bigframes.pandas.Series(data=None, index=None, dtype: BooleanDtype | Float64Dtype | Int64Dtype | StringDtype | ArrowDtype | GeometryDtype | Literal['boolean', 'Float64', 'Int64', 'int64[pyarrow]', 'string', 'string[pyarrow]', 'timestamp[us, tz=UTC][pyarrow]', 'timestamp[us][pyarrow]', 'date32[day][pyarrow]', 'time64[us][pyarrow]', 'decimal128(38, 9)[pyarrow]', 'decimal256(76, 38)[pyarrow]', 'binary[pyarrow]', 'duration[us][pyarrow]'] | None = None, name: str | None = None, copy: bool | None = None, *, session: Session | None = None)[source]#

Attributes

AlignedExprT

T

Return the transpose, which is by definition self.

at

Access a single value for a row/column label pair.

blob

dt

Accessor object for datetime-like properties of the Series values.

dtype

Return the dtype object of the underlying data.

dtypes

Return the dtypes in the DataFrame.

empty

Indicates whether Series/DataFrame is empty.

geo

Accessor object for geography properties of the Series values.

hasnans

Return True if there are any NaNs.

iat

Access a single value for a row/column pair by integer position.

iloc

Purely integer-location based indexing for selection by position.

index

The index (axis labels) of the Series.

is_monotonic_decreasing

Return boolean if values in the object are monotonically decreasing.

is_monotonic_increasing

Return boolean if values in the object are monotonically increasing.

list

loc

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

name

Return the name of the Series.

ndim

Return an int representing the number of axes / array dimensions.

plot

Make plots of Series.

query_job

BigQuery job metadata for the most recent query.

shape

Return a tuple of the shape of the underlying data.

size

Return the number of elements in the underlying data.

str

Vectorized string functions for Series and Index.

struct

Accessor object for struct properties of the Series values.

values

Return Series as ndarray or ndarray-like depending on the dtype.

Methods

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

abs()

Return a Series/DataFrame with absolute numeric value of each element.

add(other)

Return addition of Series and other, element-wise (binary operator add).

add_prefix(prefix[, axis])

Prefix labels with string prefix.

add_suffix(suffix[, axis])

Suffix labels with string suffix.

agg(func)

Aggregate using one or more operations over the specified axis.

aggregate(func)

Aggregate using one or more operations over the specified axis.

all()

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

any()

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

apply(func[, by_row, args])

Invoke function on values of a Series.

area([x, y, stacked])

Draw a stacked area plot.

argmax()

Return int position of the largest value in the series.

argmin()

Return int position of the smallest value in the Series.

astype(dtype, *[, errors])

Cast a pandas object to a specified dtype dtype.

autocorr([lag])

Compute the lag-N autocorrelation.

bar([x, y])

Draw a vertical bar plot.

between(left, right[, inclusive])

Return boolean Series equivalent to left <= series <= right.

bfill(*[, limit])

Fill NA/NaN values by using the next valid observation to fill the gap.

cache()

Materializes the Series to a temporary table.

case_when(caselist)

Replace values where the conditions are True.

clip([lower, upper])

Trim values at input threshold(s).

combine(other, func)

Combine the Series with a Series or scalar according to func.

combine_first(other)

Update null elements with value in the same location in 'other'.

copy()

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

corr(other[, method, min_periods])

Compute the correlation with the other Series.

count()

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

cov(other)

Compute covariance with Series, excluding missing values.

cummax()

Return cumulative maximum over a DataFrame or Series axis.

cummin()

Return cumulative minimum over a DataFrame or Series axis.

cumprod()

Return cumulative product over a DataFrame or Series axis.

cumsum()

Return cumulative sum over a DataFrame or Series axis.

describe()

Generate descriptive statistics.

diff([periods])

First discrete difference of element.

div(other)

Return floating division of Series and other, element-wise (binary operator truediv).

divide(other)

Return floating division of Series and other, element-wise (binary operator truediv).

divmod(other)

Return integer division and modulo of Series and other, element-wise (binary operator divmod).

dot(other)

Compute the dot product between the Series and the columns of other.

drop([labels, axis, index, columns, level])

Return Series with specified index labels removed.

drop_duplicates(*[, keep])

Return Series with duplicate values removed.

droplevel(level[, axis])

Return Series with requested index / column level(s) removed.

dropna(*[, axis, inplace, how, ignore_index])

Return a new Series with missing values removed.

duplicated([keep])

Indicate duplicate Series values.

eq(other)

Return equal of Series and other, element-wise (binary operator eq).

equals(other)

Test whether two objects contain the same elements.

expanding([min_periods])

Provide expanding window calculations.

explode(*[, ignore_index])

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

ffill(*[, limit])

Fill NA/NaN values by propagating the last valid observation to next valid.

fillna([value])

Fill NA (NULL in BigQuery) values using the specified method.

filter([items, like, regex, axis])

Subset the dataframe rows or columns according to the specified index labels.

floordiv(other)

Return integer division of Series and other, element-wise (binary operator floordiv).

ge(other)

Get 'greater than or equal to' of Series and other, element-wise (binary operator ge).

get(key[, default])

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

groupby([by, axis, level, as_index, dropna])

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

gt(other)

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

head([n])

Return the first n rows.

hist([by, bins])

Draw one histogram of the DataFrame’s columns.

idxmax()

Return the row label of the maximum value.

idxmin()

Return the row label of the minimum value.

interpolate([method])

Fill NaN values using an interpolation method.

isin(values)

Whether elements in Series are contained in values.

isna()

Detect missing (NULL) values.

isnull()

Detect missing (NULL) values.

item()

Return the first element of the underlying data as a Python scalar.

items()

Lazily iterate over (index, value) tuples.

keys()

Return alias for index.

kurt()

Return unbiased kurtosis over requested axis.

kurtosis()

Return unbiased kurtosis over requested axis.

le(other)

Get 'less than or equal to' of Series and other, element-wise (binary operator le).

line([x, y])

Plot Series or DataFrame as lines.

lt(other)

Get 'less than' of Series and other, element-wise (binary operator lt).

map(arg[, na_action, verify_integrity])

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

mask(cond[, other])

Replace values where the condition is True.

max()

Return the maximum of the values over the requested axis.

mean()

Return the mean of the values over the requested axis.

median(*[, exact])

Return the median of the values over the requested axis.

min()

Return the maximum of the values over the requested axis.

mod(other)

Return modulo of Series and other, element-wise (binary operator mod).

mode()

Return the mode(s) of the Series.

mul(other)

Return multiplication of Series and other, element-wise (binary operator mul).

multiply(other)

Return multiplication of Series and other, element-wise (binary operator mul).

ne(other)

Return not equal of Series and other, element-wise (binary operator ne).

nlargest([n, keep])

Return the largest n elements.

notna()

Detect existing (non-missing) values.

notnull()

Detect existing (non-missing) values.

nsmallest([n, keep])

Return the smallest n elements.

nunique()

Return number of unique elements in the object.

pad(*[, limit])

Fill NA/NaN values by propagating the last valid observation to next valid.

pct_change([periods])

Fractional change between the current and a prior element.

peek([n, force, allow_large_results])

Preview n arbitrary elements from the series without guarantees about row selection or ordering.

pipe(func, *args, **kwargs)

Apply chainable functions that expect Series or DataFrames.

pow(other)

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

prod()

Return the product of the values over the requested axis.

product()

Return the product of the values over the requested axis.

quantile([q])

Return value at the given quantile.

radd(other)

Return addition of Series and other, element-wise (binary operator radd).

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

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

rdiv(other)

Return floating division of Series and other, element-wise (binary operator rtruediv).

rdivmod(other)

Return integer division and modulo of Series and other, element-wise (binary operator rdivmod).

reindex([index, validate])

Conform Series to new index with optional filling logic.

reindex_like(other, *[, validate])

Return an object with matching indices as other object.

rename()

Alter Series index labels or name.

rename_axis()

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

reorder_levels(order[, axis])

Rearrange index levels using input order.

replace(to_replace[, value, regex])

Replace values given in to_replace with value.

resample(rule, *[, closed, label, level, origin])

Resample time-series data.

reset_index()

Generate a new DataFrame or Series with the index reset.

rfloordiv(other)

Return integer division of Series and other, element-wise (binary operator rfloordiv).

rmod(other)

Return modulo of Series and other, element-wise (binary operator mod).

rmul(other)

Return multiplication of Series and other, element-wise (binary operator mul).

rolling(window[, min_periods, closed])

Provide rolling window calculations.

round([decimals])

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

rpow(other)

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

rsub(other)

Return subtraction of Series and other, element-wise (binary operator rsub).

rtruediv(other)

Return floating division of Series and other, element-wise (binary operator rtruediv).

sample([n, frac, random_state, sort])

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

shift([periods])

Shift index by desired number of periods.

skew()

Return unbiased skew over requested axis.

sort_index()

Sort Series by index labels.

sort_values()

Sort by the values.

std()

Return sample standard deviation over requested axis.

sub(other)

Return subtraction of Series and other, element-wise (binary operator sub).

subtract(other)

Return subtraction of Series and other, element-wise (binary operator sub).

sum()

Return the sum of the values over the requested axis.

swaplevel([i, j])

Swap levels i and j in a MultiIndex.

tail([n])

Return the last n rows.

take(indices[, axis])

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

to_csv([path_or_buf, sep, header, index, ...])

Write object to a comma-separated values (csv) file on Cloud Storage.

to_dict([into, allow_large_results])

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

to_excel(excel_writer[, sheet_name, ...])

Write Series to an Excel sheet.

to_frame([name])

Convert Series to DataFrame.

to_json([path_or_buf, orient, lines, index, ...])

Convert the object to a JSON string, written to Cloud Storage.

to_latex([buf, columns, header, index, ...])

Render object to a LaTeX tabular, longtable, or nested table.

to_list(*[, allow_large_results])

Return a list of the values.

to_markdown([buf, mode, index, ...])

Print Series in Markdown-friendly format.

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

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

to_pandas([max_download_size, ...])

Writes Series to pandas Series.

to_pandas_batches([page_size, max_results, ...])

Stream Series results to an iterable of pandas Series.

to_pickle(path, *[, allow_large_results])

Pickle (serialize) object to file.

to_string([buf, na_rep, float_format, ...])

Render a string representation of the Series.

to_xarray(*[, allow_large_results])

Return an xarray object from the pandas object.

tolist(*[, allow_large_results])

Return a list of the values.

transpose()

Return the transpose, which is by definition self.

truediv(other)

Return floating division of Series and other, element-wise (binary operator truediv).

unique([keep_order])

Return unique values of Series object.

unstack([level])

Unstack, also known as pivot, Series with MultiIndex to produce DataFrame.

update(other)

Modify Series in place using values from passed Series.

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

Return a Series containing counts of unique values.

var()

Return unbiased variance over requested axis.

where(cond[, other])

Replace values where the condition is False.