cudf.Series#

class cudf.Series(data=None, index=None, dtype=None, name=None, nan_as_null=True)#

One-dimensional GPU array (including time series).

Labels need not be unique but must be a hashable type. The object supports both integer- and label-based indexing and provides a host of methods for performing operations involving the index. Statistical methods from ndarray have been overridden to automatically exclude missing data (currently represented as null/NaN).

Operations between Series (+, -, /, *, **) align values based on their associated index values-– they need not be the same length. The result index will be the sorted union of the two indexes.

Series objects are used as columns of DataFrame.

Parameters
dataarray-like, Iterable, dict, or scalar value

Contains data stored in Series.

indexarray-like or Index (1d)

Values must be hashable and have the same length as data. Non-unique index values are allowed. Will default to RangeIndex (0, 1, 2, …, n) if not provided. If both a dict and index sequence are used, the index will override the keys found in the dict.

dtypestr, numpy.dtype, or ExtensionDtype, optional

Data type for the output Series. If not specified, this will be inferred from data.

namestr, optional

The name to give to the Series.

nan_as_nullbool, Default True

If None/True, converts np.nan values to null values. If False, leaves np.nan values as is.

Attributes

T

Return the transpose, which is by definition self.

cat

Accessor object for categorical properties of the Series values.

data

The gpu buffer for the data

dt

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

dtype

dtype of the Series

empty

Indicator whether DataFrame or Series is empty.

has_nulls

Indicator whether Series contains null values.

index

Get the labels for the rows.

is_monotonic

Return boolean if values in the object are monotonically increasing.

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.

is_unique

Return boolean if values in the object are unique.

list

List methods for Series

name

Get the name of this object.

ndim

Get the dimensionality (always 1 for single-columned frames).

null_count

Number of null values

nullable

A boolean indicating whether a null-mask is needed

nullmask

The gpu buffer for the null-mask

shape

Get a tuple representing the dimensionality of the Index.

size

Return the number of elements in the underlying data.

str

Vectorized string functions for Series and Index.

struct

Struct methods for Series

valid_count

Number of non-null values

values

Return a CuPy representation of the DataFrame.

values_host

Return a NumPy representation of the data.

Methods

abs()

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

acos()

Get Trigonometric inverse cosine, element-wise.

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

Get Addition of dataframe or series and other, element-wise (binary operator add).

add_prefix(prefix)

Prefix labels with string prefix.

add_suffix(suffix)

Suffix labels with string suffix.

all([axis, bool_only, skipna, level])

Return whether all elements are True in DataFrame.

any([axis, bool_only, skipna, level])

Return whether any elements is True in DataFrame.

append(to_append[, ignore_index, ...])

Append values from another Series or array-like object.

apply(func[, convert_dtype, args])

Apply a scalar function to the values of a Series.

applymap(udf[, out_dtype])

Apply an elementwise function to transform the values in the Column.

argsort([axis, kind, order, ascending, ...])

Return the integer indices that would sort the Series values.

asin()

Get Trigonometric inverse sine, element-wise.

astype(dtype[, copy, errors])

Cast the object to the given dtype.

atan()

Get Trigonometric inverse tangent, element-wise.

autocorr([lag])

Compute the lag-N autocorrelation.

ceil()

Rounds each value upward to the smallest integral value not less than the original.

clip([lower, upper, inplace, axis])

Trim values at input threshold(s).

copy([deep])

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

corr(other[, method, min_periods])

Calculates the sample correlation between two Series, excluding missing values.

cos()

Get Trigonometric cosine, element-wise.

count([level])

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

cov(other[, min_periods])

Compute covariance with Series, excluding missing values.

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

Generate descriptive statistics.

deserialize(header, frames)

Generate an object from a serialized representation.

device_deserialize(header, frames)

Perform device-side deserialization tasks.

device_serialize()

Serialize data and metadata associated with device memory.

diff([periods])

Calculate the difference between values at positions i and i - N in an array and store the output in a new array.

digitize(bins[, right])

Return the indices of the bins to which each value in series belongs.

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

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

divide(other[, level, fill_value, axis])

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

dot(other[, reflect])

Get dot product of frame and other, (binary operator dot).

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

Drop specified labels from rows or columns.

drop_duplicates([keep, inplace, ignore_index])

Return Series with duplicate values removed.

dropna([axis, inplace, how])

Return a Series with null values removed.

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

Equal to, element-wise (binary operator eq).

equals(other)

Test whether two objects contain the same elements.

exp()

Get the exponential of all elements, element-wise.

explode([ignore_index])

Transform each element of a list-like to a row, replicating index values.

factorize([na_sentinel])

Encode the input values as integer labels.

fillna([value, method, axis, inplace, limit])

Fill null values with value or specified method.

first(offset)

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

floor()

Rounds each value downward to the largest integral value not greater than the original.

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

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

from_arrow(array)

Create from PyArrow Array/ChunkedArray.

from_categorical(categorical[, codes])

Creates from a pandas.Categorical

from_masked_array(data, mask[, null_count])

Create a Series with null-mask.

from_pandas(s[, nan_as_null])

Convert from a Pandas Series.

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

Greater than or equal, element-wise (binary operator ge).

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

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

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

Greater than, element-wise (binary operator gt).

hash_values([method])

Compute the hash of values in this column.

head([n])

Return the first n rows.

host_deserialize(header, frames)

Perform device-side deserialization tasks.

host_serialize()

Serialize data and metadata associated with host memory.

interleave_columns()

Interleave Series columns of a table into a single column.

interpolate([method, axis, limit, inplace, ...])

Interpolate data values between some points.

isin(values)

Check whether values are contained in Series.

isna()

Identify missing values.

isnull()

Identify missing values.

keys()

Return alias for index.

kurt([axis, skipna, level, numeric_only])

Return Fisher's unbiased kurtosis of a sample.

kurtosis([axis, skipna, level, numeric_only])

Return Fisher's unbiased kurtosis of a sample.

last(offset)

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

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

Less than or equal, element-wise (binary operator le).

log()

Get the natural logarithm of all elements, element-wise.

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

Less than, element-wise (binary operator lt).

map(arg[, na_action])

Map values of Series according to input correspondence.

mask(cond[, other, inplace])

Replace values where the condition is True.

max([axis, skipna, level, numeric_only])

Return the maximum of the values in the DataFrame.

mean([axis, skipna, level, numeric_only])

Return the mean of the values for the requested axis.

median([axis, skipna, level, numeric_only])

Return the median of the values for the requested axis.

memory_usage([index, deep])

Return the memory usage of an object.

min([axis, skipna, level, numeric_only])

Return the minimum of the values in the DataFrame.

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

Get Modulo division of dataframe or series and other, element-wise (binary operator mod).

mode([dropna])

Return the mode(s) of the dataset.

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

Get Multiplication of dataframe or series and other, element-wise (binary operator mul).

multiply(other[, level, fill_value, axis])

Get Multiplication of dataframe or series and other, element-wise (binary operator mul).

nans_to_nulls()

Convert nans (if any) to nulls

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

Not equal to, element-wise (binary operator ne).

nlargest([n, keep])

Returns a new Series of the n largest element.

notna()

Identify non-missing values.

notnull()

Identify non-missing values.

nsmallest([n, keep])

Returns a new Series of the n smallest element.

nunique([dropna])

Return count of unique values for the column.

pct_change([periods, fill_method, limit, freq])

Calculates the percent change between sequential elements in the Series.

pipe(func, *args, **kwargs)

Apply func(self, *args, **kwargs).

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

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

prod([axis, skipna, dtype, level, ...])

Return product of the values in the DataFrame.

product([axis, skipna, dtype, level, ...])

Return product of the values in the DataFrame.

quantile([q, interpolation, exact, quant_index])

Return values at the given quantile.

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

Get Addition of dataframe or series and other, element-wise (binary operator radd).

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

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

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

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

reindex([index, copy])

Return a Series that conforms to a new index

rename([index, copy])

Alter Series name

repeat(repeats[, axis])

Repeats elements consecutively.

replace([to_replace, value])

Replace values given in to_replace with value.

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

Convert the frequency of ("resample") the given time series data.

reset_index([level, drop, name, inplace])

Reset the index of the Series, or a level of it.

rfloordiv(other[, level, fill_value, axis])

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

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

Get Modulo division of dataframe or series and other, element-wise (binary operator rmod).

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

Get Multiplication of dataframe or series and other, element-wise (binary operator rmul).

rolling(window[, min_periods, center, axis, ...])

Rolling window calculations.

round([decimals, how])

Round to a variable number of decimal places.

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

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

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

Get Subtraction of dataframe or series and other, element-wise (binary operator rsub).

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

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

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

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

scale()

Scale values to [0, 1] in float64

scatter_by_map(map_index[, map_size, keep_index])

Scatter to a list of dataframes.

searchsorted(values[, side, ascending, ...])

Find indices where elements should be inserted to maintain order

serialize()

Generate an equivalent serializable representation of an object.

shift([periods, freq, axis, fill_value])

Shift values by periods positions.

sin()

Get Trigonometric sine, element-wise.

skew([axis, skipna, level, numeric_only])

Return unbiased Fisher-Pearson skew of a sample.

sort_index([axis])

Sort object by labels (along an axis).

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

Sort by the values along either axis.

sqrt()

Get the non-negative square-root of all elements, element-wise.

std([axis, skipna, level, ddof, numeric_only])

Return sample standard deviation of the DataFrame.

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

Get Subtraction of dataframe or series and other, element-wise (binary operator sub).

subtract(other[, level, fill_value, axis])

Get Subtraction of dataframe or series and other, element-wise (binary operator sub).

sum([axis, skipna, dtype, level, ...])

Return sum of the values in the DataFrame.

sum_of_squares([dtype])

Return the sum of squares of values.

tail([n])

Returns the last n rows as a new DataFrame or Series

take(indices[, axis])

Return a new frame containing the rows specified by indices.

tan()

Get Trigonometric tangent, element-wise.

tile(count)

Repeats the rows from self DataFrame count times to form a new DataFrame.

to_arrow()

Convert to a PyArrow Array.

to_cupy([dtype, copy, na_value])

Convert the Frame to a CuPy array.

to_dlpack()

Converts a cuDF object into a DLPack tensor.

to_frame([name])

Convert Series into a DataFrame

to_hdf(path_or_buf, key, *args, **kwargs)

Write the contained data to an HDF5 file using HDFStore.

to_json([path_or_buf])

Convert the cuDF object to a JSON string.

to_numpy([dtype, copy, na_value])

Convert the Frame to a NumPy array.

to_pandas([index, nullable])

Convert to a Pandas Series.

to_string()

Convert to string

transpose()

Return the transpose, which is by definition self.

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

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

unique()

Returns unique values of this Series.

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([axis, skipna, level, ddof, numeric_only])

Return unbiased variance of the DataFrame.

where(cond[, other, inplace])

Replace values where the condition is False.

cummax

cummin

cumprod

cumsum

items

iteritems

logical_and

logical_not

logical_or

merge

remainder

to_dict

to_list

tolist