Series#
Constructor#
|
One-dimensional GPU array (including time series). |
Attributes#
Axes
Return a list representing the axes of the Series. |
|
Get the labels for the rows. |
|
Return a CuPy representation of the DataFrame. |
|
The gpu buffer for the data |
|
The dtype of the Series. |
|
Get a tuple representing the dimensionality of the Index. |
|
Number of dimensions of the underlying data, by definition 1. |
|
A boolean indicating whether a null-mask is needed |
|
The gpu buffer for the null-mask |
|
Number of null values |
|
Return the number of elements in the underlying data. |
|
Return the transpose, which is by definition self. |
|
|
Return the memory usage of an object. |
Return True if there are any NaNs or nulls. |
|
Indicator whether Series contains null values. |
|
Indicator whether DataFrame or Series is empty. |
|
Get the name of this object. |
|
Number of non-null values |
|
Return a NumPy representation of the data. |
Conversion#
|
Cast the object to the given dtype. |
|
Make a copy of this object's indices and data. |
|
|
Scale values to [0, 1] in float64 |
Indexing, iteration#
Select rows and columns by label or boolean mask. |
|
Select values by position. |
|
Iteration is unsupported. |
|
Iteration is unsupported. |
|
Iteration is unsupported. |
|
Return alias for index. |
Binary operator functions#
|
Get Addition of DataFrame or Series and other, element-wise (binary operator add). |
|
Get Subtraction of DataFrame or Series and other, element-wise (binary operator sub). |
|
Get Subtraction of DataFrame or Series and other, element-wise (binary operator sub). |
|
Get Multiplication of DataFrame or Series and other, element-wise (binary operator mul). |
|
Get Multiplication of DataFrame or Series and other, element-wise (binary operator mul). |
|
Get Floating division of DataFrame or Series and other, element-wise (binary operator truediv). |
|
Get Floating division of DataFrame or Series and other, element-wise (binary operator truediv). |
|
Get Floating division of DataFrame or Series and other, element-wise (binary operator truediv). |
|
Get Integer division of DataFrame or Series and other, element-wise (binary operator floordiv). |
|
Get Modulo of DataFrame or Series and other, element-wise (binary operator mod). |
|
Get Exponential of DataFrame or Series and other, element-wise (binary operator pow). |
|
Get Addition of DataFrame or Series and other, element-wise (binary operator radd). |
|
Get Subtraction of DataFrame or Series and other, element-wise (binary operator rsub). |
|
Get Multiplication of DataFrame or Series and other, element-wise (binary operator rmul). |
|
Get Floating division of DataFrame or Series and other, element-wise (binary operator rtruediv). |
|
Get Floating division of DataFrame or Series and other, element-wise (binary operator rtruediv). |
|
Get Integer division of DataFrame or Series and other, element-wise (binary operator rfloordiv). |
|
Get Modulo of DataFrame or Series and other, element-wise (binary operator rmod). |
|
Get Exponential of DataFrame or Series and other, element-wise (binary operator rpow). |
|
Round to a variable number of decimal places. |
|
Get Less than of DataFrame or Series and other, element-wise (binary operator lt). |
|
Get Greater than of DataFrame or Series and other, element-wise (binary operator gt). |
|
Get Less than or equal to of DataFrame or Series and other, element-wise (binary operator le). |
|
Get Greater than or equal to of DataFrame or Series and other, element-wise (binary operator ge). |
|
Get Not equal to of DataFrame or Series and other, element-wise (binary operator ne). |
|
Get Equal to of DataFrame or Series and other, element-wise (binary operator eq). |
|
Return product of the values in the DataFrame. |
|
Get dot product of frame and other, (binary operator dot). |
Function application, GroupBy & window#
|
Apply a scalar function to the values of a Series. |
|
Map values of Series according to input correspondence. |
|
Group using a mapper or by a Series of columns. |
|
Rolling window calculations. |
|
Apply |
Computations / descriptive stats#
Return a Series/DataFrame with absolute numeric value of each element. |
|
|
Return whether all elements are True in DataFrame. |
|
Return whether any elements is True in DataFrame. |
|
Compute the lag-N autocorrelation. |
|
Return boolean Series equivalent to left <= series <= right. |
|
Trim values at input threshold(s). |
|
Calculates the sample correlation between two Series, excluding missing values. |
|
Return number of non-NA/null observations in the Series |
|
Compute covariance with Series, excluding missing values. |
|
Return cumulative max of the Series. |
|
Return cumulative min of the Series. |
|
Return cumulative product of the Series. |
|
Return cumulative sum of the Series. |
|
Generate descriptive statistics. |
|
First discrete difference of element. |
|
Return the indices of the bins to which each value belongs. |
|
Encode the input values as integer labels. |
|
Return Fisher's unbiased kurtosis of a sample. |
|
Return the maximum of the values in the DataFrame. |
|
Return the mean of the values for the requested axis. |
|
Return the median of the values for the requested axis. |
|
Return the minimum of the values in the DataFrame. |
|
Return the mode(s) of the dataset. |
|
Returns a new Series of the n largest element. |
|
Returns a new Series of the n smallest element. |
|
Calculates the percent change between sequential elements in the Series. |
|
Return product of the values in the DataFrame. |
|
Return values at the given quantile. |
|
Compute numerical data ranks (1 through n) along axis. |
|
Return unbiased Fisher-Pearson skew of a sample. |
|
Return sample standard deviation of the DataFrame. |
|
Return sum of the values in the DataFrame. |
|
Return unbiased variance of the DataFrame. |
|
Return Fisher's unbiased kurtosis of a sample. |
Returns unique values of this Series. |
|
|
Return count of unique values for the column. |
Return boolean if values in the object are unique. |
|
Return boolean if values in the object are monotonically increasing. |
|
Return boolean if values in the object are monotonically increasing. |
|
Return boolean if values in the object are monotonically decreasing. |
|
|
Return a Series containing counts of unique values. |
Reindexing / selection / label manipulation#
|
Prefix labels with string prefix. |
|
Suffix labels with string suffix. |
|
Drop specified labels from rows or columns. |
|
Return Series with duplicate values removed. |
|
Indicate duplicate Series values. |
|
Test whether two objects contain the same elements. |
|
Select initial periods of time series data based on a date offset. |
|
Return the first n rows. |
|
Check whether values are contained in Series. |
|
Select final periods of time series data based on a date offset. |
|
Conform Series to new index. |
|
Alter Series name |
|
Reset the index of the Series, or a level of it. |
|
Return a random sample of items from an axis of object. |
|
Return a new frame containing the rows specified by indices. |
|
Returns the last n rows as a new DataFrame or Series |
|
Repeats the rows count times to form a new Frame. |
|
Truncate a Series or DataFrame before and after some index value. |
|
Replace values where the condition is False. |
|
Replace values where the condition is True. |
Missing data handling#
|
Synonym for |
|
Synonym for |
|
Return a Series with null values removed. |
|
Synonym for |
|
Fill null values with |
Identify missing values. |
|
Identify missing values. |
|
Convert nans (if any) to nulls |
|
Identify non-missing values. |
|
Identify non-missing values. |
|
|
Synonym for |
|
Replace values given in |
Reshaping, sorting#
|
Return the integer indices that would sort the Series values. |
|
Sort by the values along either axis. |
|
Sort object by labels (along an axis). |
|
Transform each element of a list-like to a row, replicating index values. |
|
Find indices where elements should be inserted to maintain order |
|
Repeats elements consecutively. |
Return the transpose, which is by definition self. |
Combining / comparing / joining / merging#
|
Append values from another |
|
Modify Series in place using values from passed Series. |
Accessors#
pandas provides dtype-specific methods under various accessors.
These are separate namespaces within Series
that only apply
to specific data types.
Data Type |
Accessor |
---|---|
Datetime, Timedelta |
|
String |
|
Categorical |
|
List |
|
Struct |
Datetimelike properties#
Series.dt
can be used to access the values of the series as
datetimelike and return several properties.
These can be accessed like Series.dt.<property>
.
Datetime properties#
The year of the datetime. |
|
The month as January=1, December=12. |
|
The day of the datetime. |
|
The hours of the datetime. |
|
The minutes of the datetime. |
|
The seconds of the datetime. |
|
The microseconds of the datetime. |
|
The nanoseconds of the datetime. |
|
The day of the week with Monday=0, Sunday=6. |
|
The day of the week with Monday=0, Sunday=6. |
|
The day of the year, from 1-365 in non-leap years and from 1-366 in leap years. |
|
The day of the year, from 1-365 in non-leap years and from 1-366 in leap years. |
|
Integer indicator for which quarter of the year the date belongs in. |
|
Booleans indicating if dates are the first day of the month. |
|
Boolean indicator if the date is the last day of the month. |
|
Boolean indicator if the date is the first day of a quarter. |
|
Boolean indicator if the date is the last day of a quarter. |
|
Boolean indicator if the date is the first day of the year. |
|
Boolean indicator if the date is the last day of the year. |
|
Boolean indicator if the date belongs to a leap year. |
|
Get the total number of days in the month that the date falls on. |
Datetime methods#
Returns a DataFrame with the year, week, and day calculated according to the ISO 8601 standard. |
|
|
Convert to Series using specified |
|
Perform round operation on the data to the specified freq. |
|
Perform floor operation on the data to the specified freq. |
|
Perform ceil operation on the data to the specified freq. |
Timedelta properties#
Number of days. |
|
Number of seconds (>= 0 and less than 1 day). |
|
Number of microseconds (>= 0 and less than 1 second). |
|
Return the number of nanoseconds (n), where 0 <= n < 1 microsecond. |
|
Return a Dataframe of the components of the Timedeltas. |
String handling#
Series.str
can be used to access the values of the series as
strings and apply several methods to it. These can be accessed like
Series.str.<function/property>
.
Computes the number of bytes of each string in the Series/Index. |
|
Convert strings in the Series/Index to be capitalized. |
|
|
Concatenate strings in the Series/Index with given separator. |
|
Filling left and right side of strings in the Series/Index with an additional character. |
|
Generate the n-grams from characters in a column of strings. |
Each string is split into individual characters. |
|
Returns an array by filling it with the UTF-8 code point values for each character of each string. |
|
|
Test if pattern or regex is contained within a string of a Series or Index. |
|
Count occurrences of pattern in each string of the Series/Index. |
|
Combines tokens into strings by concatenating them in the order in which they appear in the |
|
The |
Computes the edit distance between strings in the series. |
|
|
Test if the end of each string element matches a pattern. |
|
Extract capture groups in the regex pat as columns in a DataFrame. |
|
Remove non-alphanumeric characters from strings in this column. |
|
Remove characters from each string using the character ranges in the given mapping table. |
|
Remove tokens from within each string in the series that are smaller than min_token_length and optionally replace them with the replacement string. |
|
Return lowest indexes in each strings in the Series/Index where the substring is fully contained between |
|
Find all occurrences of pattern or regular expression in the Series/Index. |
|
Find all first occurrences of patterns in the Series/Index. |
|
Extract element from each component at specified position. |
|
Applies a JSONPath string to an input strings column where each row in the column is a valid json string |
Returns integer value represented by each hex string. |
|
|
Returns integer value represented by each hex string. |
|
Return lowest indexes in each strings where the substring is fully contained between |
|
Insert the specified string into each string in the specified position. |
|
This converts ip strings to integers |
This converts ip strings to integers |
|
|
Return true for strings where the character at |
|
Return true for strings where the character at |
|
Check whether all characters in each string are alphanumeric. |
|
Check whether all characters in each string are alphabetic. |
Check whether all characters in each string are decimal. |
|
|
Check whether all characters in each string are digits. |
|
Check whether each string is an empty string. |
|
Check whether all characters in each string form floating value. |
|
Check whether all characters in each string form a hex integer. |
Check whether all characters in each string form integer. |
|
|
Check whether all characters in each string form an IPv4 address. |
|
Check whether all characters in each string are whitespace. |
|
Check whether all characters in each string are lowercase. |
Check whether all characters in each string are numeric. |
|
|
Check whether all characters in each string are uppercase. |
|
Check whether all characters in each string can be converted to a timestamp using the given format. |
|
Check whether each string is title formatted. |
|
Join lists contained as elements in the Series/Index with passed delimiter. |
|
Computes the length of each element in the Series/Index. |
|
Test if a like pattern matches a string of a Series or Index. |
|
Filling right side of strings in the Series/Index with an additional character. |
|
Converts all characters to lowercase. |
|
Remove leading and trailing characters. |
|
Determine if each string matches a regular expression. |
|
Generate the n-grams from a set of tokens, each record in series is treated a token. |
|
Generate the n-grams using tokens from each string. |
|
Normalizes strings characters for tokenizing. |
Remove extra whitespace between tokens and trim whitespace from the beginning and the end of each string. |
|
|
Pad strings in the Series/Index up to width. |
|
Split the string at the first occurrence of sep. |
Compute the Porter Stemmer measure for each string. |
|
|
Duplicate each string in the Series or Index. |
|
Remove a prefix from an object series. |
|
Remove a suffix from an object series. |
|
Replace occurrences of pattern/regex in the Series/Index with some other string. |
|
The targets tokens are searched for within each string in the series and replaced with the corresponding replacements if found. |
|
Use the |
|
Return highest indexes in each strings in the Series/Index where the substring is fully contained between |
|
Return highest indexes in each strings where the substring is fully contained between |
|
Filling left side of strings in the Series/Index with an additional character. |
|
Split the string at the last occurrence of sep. |
|
Split strings around given separator/delimiter. |
|
Remove leading and trailing characters. |
|
Slice substrings from each element in the Series or Index. |
|
Return substring of each string using positions for each string. |
|
Replace the specified section of each string with a new string. |
|
Split strings around given separator/delimiter. |
|
Split strings around given separator/delimiter. |
|
Test if the start of each string element matches a pattern. |
|
Remove leading and trailing characters. |
|
Change each lowercase character to uppercase and vice versa. |
|
Uppercase the first letter of each letter after a space and lowercase the rest. |
|
Each string is split into tokens using the provided delimiter. |
|
Each string is split into tokens using the provided delimiter(s). |
|
Map all characters in the string through the given mapping table. |
|
Convert each string to uppercase. |
Returns a URL-decoded format of each string. |
|
Returns a URL-encoded format of each string. |
|
|
Wrap long strings in the Series/Index to be formatted in paragraphs with length less than a given width. |
|
Pad strings in the Series/Index by prepending '0' characters. |
Categorical accessor#
Categorical-dtype specific methods and attributes are available under
the Series.cat
accessor.
The categories of this categorical. |
|
Whether the categories have an ordered relationship. |
|
Return Series of codes as well as the index. |
|
|
Reorder categories as specified in new_categories. |
|
Add new categories. |
|
Remove the specified categories. |
|
Set the categories to the specified new_categories. |
|
Set the Categorical to be ordered. |
|
Set the Categorical to be unordered. |
List handling#
Series.list
can be used to access the values of the series as
lists and apply list methods to it. These can be accessed like
Series.list.<function/property>
.
|
Return a new list Series with the leaf values casted to the specified data type. |
|
For a column with at least one level of nesting, concatenate the lists in each row. |
|
Returns boolean values indicating whether the specified scalar is an element of each row. |
|
Returns integers representing the index of the search key for each row. |
|
Extract element at the given index from each list in a Series of lists. |
From a Series of (possibly nested) lists, obtain the elements from the innermost lists as a flat Series (one value per row). |
|
|
Computes the length of each element in the Series/Index. |
|
Sort each list by the values. |
|
Collect list elements based on given indices. |
|
Returns the unique elements in each list. |
Struct handling#
Series.struct
can be used to access the values of the series as
Structs and apply struct methods to it. These can be accessed like
Series.struct.<function/property>
.
|
Extract children of the specified struct column in the Series |
|
Return a DataFrame whose columns are the fields of this struct Series. |
Serialization / IO / conversion#
Convert to a PyArrow Array. |
|
|
Convert the Frame to a CuPy array. |
|
Convert Series to {label -> value} dict or dict-like object. |
Converts a cuDF object into a DLPack tensor. |
|
|
Convert Series into a DataFrame |
|
Write the contained data to an HDF5 file using HDFStore. |
|
Convert the cuDF object to a JSON string. |
|
Convert the Frame to a NumPy array. |
|
Convert to a Pandas Series. |
Convert to string |
|
|
Create from PyArrow Array/ChunkedArray. |
|
Creates from a pandas.Categorical |
|
Create a Series with null-mask. |
|
Convert from a Pandas Series. |
|
Compute the hash of values in this column. |