Get an array with the cumulative count computed at every element.
Optional
reverse: booleanGet an array with the cumulative max computes at every element.
Optional
reverse: booleanreverse the operation
Get an array with the cumulative min computed at every element.
Optional
reverse: booleanreverse the operation
Get an array with the cumulative product computed at every element.
Optional
reverse: booleanreverse the operation
Get an array with the cumulative sum computed at every element.
Optional
reverse: booleanreverse the operation
Clip (limit) the values in an array to any value that fits in 64 floating point range. Only works for the following dtypes: {Int32, Int64, Float32, Float64, UInt32}. If you want to clip other dtypes, consider writing a when -> then -> otherwise expression
Minimum value
Maximum value
Round underlying floating point data by decimals
digits.
Similar functionality to javascript toFixed
number of decimals to round by.
Sample from this DataFrame by setting either n
or frac
.
Optional
opts: { Optional
seed?: number | bigintOptional
withOptional
opts: { Optional
seed?: number | bigintOptional
withOptional
n: numberOptional
frac: numberOptional
withReplacement: booleanOptional
seed: number | bigintGet the index values that would sort this Series.
indexes - Indexes that can be used to sort this array.
Optional
descending: booleanOptional
nullsLast: booleanOptional
descending?: booleanOptional
nullsOptional
nullsOptional
reverse?: booleanCast between data types.
Optional
strict: booleanOptional
strict: boolean__Quick summary statistics of a series. __
Series with mixed datatypes will return summary statistics for the datatype of the first value.
> const seriesNum = pl.Series([1,2,3,4,5])
> series_num.describe()
shape: (6, 2)
┌──────────────┬────────────────────┐
│ statistic ┆ value │
│ --- ┆ --- │
│ str ┆ f64 │
╞══════════════╪════════════════════╡
│ "min" ┆ 1 │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ "max" ┆ 5 │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ "null_count" ┆ 0.0 │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ "mean" ┆ 3 │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ "std" ┆ 1.5811388300841898 │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ "count" ┆ 5 │
└──────────────┴────────────────────┘
> series_str = pl.Series(["a", "a", None, "b", "c"])
> series_str.describe()
shape: (3, 2)
┌──────────────┬───────┐
│ statistic ┆ value │
│ --- ┆ --- │
│ str ┆ i64 │
╞══════════════╪═══════╡
│ "unique" ┆ 4 │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┤
│ "null_count" ┆ 1 │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┤
│ "count" ┆ 5 │
└──────────────┴───────┘
Calculates the n-th discrete difference.
number of slots to shift
'ignore' | 'drop'
Exponentially-weighted moving average.
Expr that evaluates to a float 64 Series.
Optional
alpha: numberOptional
adjust: booleanOptional
minPeriods: numberOptional
bias: booleanOptional
ignoreNulls: booleanOptional
adjust?: booleanOptional
alpha?: numberOptional
bias?: booleanOptional
ignoreOptional
minExponentially-weighted standard deviation.
Expr that evaluates to a float 64 Series.
Optional
alpha: numberOptional
adjust: booleanOptional
minPeriods: numberOptional
bias: booleanOptional
ignoreNulls: booleanOptional
adjust?: booleanOptional
alpha?: numberOptional
bias?: booleanOptional
ignoreOptional
minExponentially-weighted variance.
Expr that evaluates to a float 64 Series.
Optional
alpha: numberOptional
adjust: booleanOptional
minPeriods: numberOptional
bias: booleanOptional
ignoreNulls: booleanOptional
adjust?: booleanOptional
alpha?: numberOptional
bias?: booleanOptional
ignoreOptional
minFill null values with a filling strategy.
Filling Strategy
Hash the Series
The hash value is of type UInt64
Optional
k0: number | bigintseed parameter
Optional
k1: number | bigintseed parameter
Optional
k2: number | bigintseed parameter
Optional
k3: number | bigintseed parameter
Optional
k0?: number | bigintOptional
k1?: number | bigintOptional
k2?: number | bigintOptional
k3?: number | bigintInterpolate intermediate values.
The interpolation method is linear.
Optional
method: InterpolationMethodCompute the kurtosis (Fisher or Pearson) of a dataset.
Kurtosis is the fourth central moment divided by the square of the variance. If Fisher's definition is used, then 3.0 is subtracted from the result to give 0.0 for a normal distribution. If bias is False then the kurtosis is calculated using k statistics to eliminate bias coming from biased moment estimators
Optional
bias: booleanOptional
bias?: booleanOptional
fisher?: booleanAssign ranks to data, dealing with ties appropriately.
Optional
method: RankMethodThe method used to assign ranks to tied elements.
Optional
descending: booleanRank in descending order.
Reinterpret the underlying bits as a signed/unsigned integer.
This operation is only allowed for 64bit integers. For lower bits integers, you can safely use that cast operation.
Optional
signed: booleansigned or unsigned
Rename this Series.
new name
Optional
inSerializes object to desired format via serde
Check if series is equal with another Series.
Shift the values by a given period
the parts that will be empty due to this operation will be filled with fillValue
.
Number of places to shift (may be negative).
Fill null & undefined values with the result of this expression.
Compute the sample skewness of a data set.
For normally distributed data, the skewness should be about zero. For
unimodal continuous distributions, a skewness value greater than zero means
that there is more weight in the right tail of the distribution. The
function skewtest
can be used to determine if the skewness value
is close enough to zero, statistically speaking.
Optional
bias: booleanIf false, then the calculations are corrected for statistical bias.
Sort this Series.
Optional
descending?: booleanOptional
nullsOptional
nullsOptional
reverse?: booleanGet dummy/indicator variables.
Optional
separator: stringOptional
dropFirst: booleanconst s = pl.Series("a", [1, 2, 3])
>>> s.toDummies()
shape: (3, 3)
┌─────┬─────┬─────┐
│ a_1 ┆ a_2 ┆ a_3 │
│ --- ┆ --- ┆ --- │
│ u8 ┆ u8 ┆ u8 │
╞═════╪═════╪═════╡
│ 1 ┆ 0 ┆ 0 │
│ 0 ┆ 1 ┆ 0 │
│ 0 ┆ 0 ┆ 1 │
└─────┴─────┴─────┘
>>> s.toDummies(":", true)
shape: (3, 2)
┌─────┬─────┐
│ a:2 ┆ a:3 │
│ --- ┆ --- │
│ u8 ┆ u8 │
╞═════╪═════╡
│ 0 ┆ 0 │
│ 1 ┆ 0 │
│ 0 ┆ 1 │
└─────┴─────┘
Count the unique values in a Series.
Optional
sort: booleanSort the output by count in descending order.
If set to False
(default), the order of the output is random.
Optional
parallel: booleanExecute the computation in parallel. .. note:: This option should likely not be enabled in a group by context, as the computation is already parallelized per group.
Optional
name: stringGive the resulting count column a specific name;
if normalize
is True defaults to "count", otherwise defaults to "proportion".
Optional
normalize: booleanIf true gives relative frequencies of the unique values
Apply a rolling max (moving max) over the values in this Series.
A window of length window_size
will traverse the series. The values that fill this window
will (optionally) be multiplied with the weights given by the weight
vector.
The resulting parameters' values will be aggregated into their sum.
Optional
weights: number[]Optional
minPeriods: number[]Optional
center: booleanApply a rolling mean (moving mean) over the values in this Series.
A window of length window_size
will traverse the series. The values that fill this window
will (optionally) be multiplied with the weights given by the weight
vector.
The resulting parameters' values will be aggregated into their sum.
Optional
weights: number[]Optional
minPeriods: number[]Optional
center: booleanCompute a rolling median
Optional
weights: number[]Optional
minPeriods: number[]Optional
center: booleanApply a rolling min (moving min) over the values in this Series.
A window of length window_size
will traverse the series. The values that fill this window
will (optionally) be multiplied with the weights given by the weight
vector.
The resulting parameters' values will be aggregated into their sum.
Optional
weights: number[]Optional
minPeriods: number[]Optional
center: booleanCompute a rolling quantile
Optional
interpolation: InterpolationMethodOptional
windowSize: numberOptional
weights: number[]Optional
minPeriods: number[]Optional
center: booleanOptional
by: stringOptional
closed: ClosedWindowCompute a rolling skew
Size of the rolling window
Optional
bias: booleanIf false, then the calculations are corrected for statistical bias.
Compute a rolling skew
Compute a rolling std dev
A window of length window_size
will traverse the array. The values that fill this window
will (optionally) be multiplied with the weights given by the weight
vector. The resulting
values will be aggregated to their sum.
Optional
weights: number[]Optional
minPeriods: number[]Optional
center: booleanOptional
ddof: numberApply a rolling sum (moving sum) over the values in this Series.
A window of length window_size
will traverse the series. The values that fill this window
will (optionally) be multiplied with the weights given by the weight
vector.
The resulting parameters' values will be aggregated into their sum.
Optional
weights: number[]Optional
minPeriods: number[]Optional
center: booleanCompute a rolling variance.
A window of length window_size
will traverse the series. The values that fill this window
will (optionally) be multiplied with the weights given by the weight
vector.
The resulting parameters' values will be aggregated into their sum.
Optional
weights: number[]Optional
minPeriods: number[]Optional
center: booleanOptional
ddof: number
A Series represents a single column in a polars DataFrame.