Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Accessors

  • get date(): ExprDateTime
  • get lst(): ExprList
  • get str(): ExprString
  • get struct(): ExprStruct

Methods

  • [INSPECT_SYMBOL](): string
  • [toStringTag](): string
  • alias(name: string): Expr
  • Rename the output of an expression.

    see

    Expr.as

    example
    >>> df = pl.DataFrame({
    ... "a": [1, 2, 3],
    ... "b": ["a", "b", None],
    ... })
    >>> df
    shape: (3, 2)
    ╭─────┬──────╮
    ab
    │ --- ┆ --- │
    i64str
    ╞═════╪══════╡
    1"a"
    ├╌╌╌╌╌┼╌╌╌╌╌╌┤
    2"b"
    ├╌╌╌╌╌┼╌╌╌╌╌╌┤
    3null
    ╰─────┴──────╯
    >>> df.select([
    ... pl.col("a").alias("bar"),
    ... pl.col("b").alias("foo"),
    ... ])
    shape: (3, 2)
    ╭─────┬──────╮
    barfoo
    │ --- ┆ --- │
    i64str
    ╞═════╪══════╡
    1"a"
    ├╌╌╌╌╌┼╌╌╌╌╌╌┤
    2"b"
    ├╌╌╌╌╌┼╌╌╌╌╌╌┤
    3null
    ╰─────┴──────╯

    Parameters

    • name: string

      new name

    Returns Expr

  • and(other: any): Expr
  • argSort(reverse?: boolean): Expr
  • argSort(__namedParameters: { reverse: boolean }): Expr
  • Get the index values that would sort this column.

    Parameters

    • Optional reverse: boolean
      - false -> order from small to large.
      - true -> order from large to small.

    Returns Expr

    UInt32 Series

  • Parameters

    • __namedParameters: { reverse: boolean }
      • reverse: boolean

    Returns Expr

  • as(name: string): Expr
  • backwardFill(): Expr
  • cast(dtype: DataType, strict?: boolean): Expr
  • Ceil underlying floating point array to the highest integers smaller or equal to the float value. Only works on floating point Series

    Returns Expr

  • clip(min: number, max: number): Expr
  • clip(options: { max: number; min: number }): any
  • 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

    Parameters

    • min: number

      Minimum value

    • max: number

      Maximum value

    Returns Expr

  • Parameters

    • options: { max: number; min: number }
      • max: number
      • min: number

    Returns any

  • cumCount(reverse?: boolean): Expr
  • cumCount(__namedParameters: { reverse: boolean }): Expr
  • Get an array with the cumulative count computed at every element.

    Parameters

    • Optional reverse: boolean

    Returns Expr

  • Parameters

    • __namedParameters: { reverse: boolean }
      • reverse: boolean

    Returns Expr

  • cumMax(reverse?: boolean): Expr
  • cumMax(__namedParameters: { reverse: boolean }): Expr
  • Get an array with the cumulative max computes at every element.


    example
    > const s = pl.Series("a", [1, 2, 3])
    > s.cumMax()
    shape: (3,)
    Series: 'b' [i64]
    [
    1
    2
    3
    ]

    Parameters

    • Optional reverse: boolean

      reverse the operation

    Returns Expr

  • Parameters

    • __namedParameters: { reverse: boolean }
      • reverse: boolean

    Returns Expr

  • cumMin(reverse?: boolean): Expr
  • cumMin(__namedParameters: { reverse: boolean }): Expr
  • Get an array with the cumulative min computed at every element.


    example
    > const s = pl.Series("a", [1, 2, 3])
    > s.cumMin()
    shape: (3,)
    Series: 'b' [i64]
    [
    1
    1
    1
    ]

    Parameters

    • Optional reverse: boolean

      reverse the operation

    Returns Expr

  • Parameters

    • __namedParameters: { reverse: boolean }
      • reverse: boolean

    Returns Expr

  • cumProd(reverse?: boolean): Expr
  • cumProd(__namedParameters: { reverse: boolean }): Expr
  • Get an array with the cumulative product computed at every element.


    example
    > const s = pl.Series("a", [1, 2, 3])
    > s.cumProd()
    shape: (3,)
    Series: 'b' [i64]
    [
    1
    2
    6
    ]

    Parameters

    • Optional reverse: boolean

      reverse the operation

    Returns Expr

  • Parameters

    • __namedParameters: { reverse: boolean }
      • reverse: boolean

    Returns Expr

  • cumSum(reverse?: boolean): Expr
  • cumSum(__namedParameters: { reverse: boolean }): Expr
  • Get an array with the cumulative sum computed at every element.


    example
    > const s = pl.Series("a", [1, 2, 3])
    > s.cumSum()
    shape: (3,)
    Series: 'b' [i64]
    [
    1
    3
    6
    ]

    Parameters

    • Optional reverse: boolean

      reverse the operation

    Returns Expr

  • Parameters

    • __namedParameters: { reverse: boolean }
      • reverse: boolean

    Returns Expr

  • diff(n: number, nullBehavior: "ignore" | "drop"): Expr
  • diff(o: { n: number; nullBehavior: "ignore" | "drop" }): Expr
  • Calculate the n-th discrete difference.

    Parameters

    • n: number

      number of slots to shift

    • nullBehavior: "ignore" | "drop"

      ignore or drop

    Returns Expr

  • Parameters

    • o: { n: number; nullBehavior: "ignore" | "drop" }
      • n: number
      • nullBehavior: "ignore" | "drop"

    Returns Expr

  • divideBy(rhs: any): Expr
  • dot(other: any): Expr
  • Compute the dot/inner product between two Expressions

    Parameters

    • other: any

      Expression to compute dot product with

    Returns Expr

  • equals(rhs: any): Expr
  • exclude(column: string, ...columns: string[]): Expr
  • Exclude certain columns from a wildcard/regex selection.

    You may also use regexes in the exclude list. They must start with ^ and end with $.

    example
     >>> df = pl.DataFrame({
    ... "a": [1, 2, 3],
    ... "b": ["a", "b", None],
    ... "c": [None, 2, 1],
    ...})
    >>> df
    shape: (3, 3)
    ╭─────┬──────┬──────╮
    abc
    │ --- ┆ --- ┆ --- │
    i64stri64
    ╞═════╪══════╪══════╡
    1"a"null
    ├╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌╌┤
    2"b"2
    ├╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌╌┤
    3null1
    ╰─────┴──────┴──────╯
    >>> df.select(
    ... pl.col("*").exclude("b"),
    ... )
    shape: (3, 2)
    ╭─────┬──────╮
    ac
    │ --- ┆ --- │
    i64i64
    ╞═════╪══════╡
    1null
    ├╌╌╌╌╌┼╌╌╌╌╌╌┤
    22
    ├╌╌╌╌╌┼╌╌╌╌╌╌┤
    31
    ╰─────┴──────╯

    Parameters

    • column: string
    • Rest ...columns: string[]

      Column(s) to exclude from selection

    Returns Expr

  • extend(value: any, n: number): Expr
  • extend(opt: { n: number; value: any }): Expr
  • Extend the Series with given number of values.

    deprecated
    see

    extendConstant

    Parameters

    • value: any

      The value to extend the Series with. This value may be null to fill with nulls.

    • n: number

      The number of values to extend.

    Returns Expr

  • Parameters

    • opt: { n: number; value: any }
      • n: number
      • value: any

    Returns Expr

  • extendConstant(value: any, n: number): Expr
  • extendConstant(opt: { n: number; value: any }): Expr
  • Extend the Series with given number of values.

    Parameters

    • value: any

      The value to extend the Series with. This value may be null to fill with nulls.

    • n: number

      The number of values to extend.

    Returns Expr

  • Parameters

    • opt: { n: number; value: any }
      • n: number
      • value: any

    Returns Expr

  • fillNan(other: any): Expr
  • fillNull(other: any): Expr
  • Filter a single column.

    Mostly useful in in aggregation context. If you want to filter on a DataFrame level, use LazyFrame.filter.

    Parameters

    • predicate: Expr

      Boolean expression.

    Returns Expr

  • Floor underlying floating point array to the lowest integers smaller or equal to the float value. Only works on floating point Series

    Returns Expr

  • greaterThan(rhs: any): Expr
  • greaterThanEquals(rhs: any): Expr
  • gtEq(rhs: any): Expr
  • hash(k0?: number, k1?: number, k2?: number, k3?: number): Expr
  • hash(__namedParameters: { k0?: number; k1?: number; k2?: number; k3?: number }): Expr
  • Hash the Series.

    Parameters

    • Optional k0: number
    • Optional k1: number
    • Optional k2: number
    • Optional k3: number

    Returns Expr

  • Parameters

    • __namedParameters: { k0?: number; k1?: number; k2?: number; k3?: number }
      • Optional k0?: number
      • Optional k1?: number
      • Optional k2?: number
      • Optional k3?: number

    Returns Expr

  • head(length?: number): Expr
  • head(__namedParameters: { length: number }): Expr
  • inner(): any
  • isDuplicated(): Expr
  • isIn(other: any): Expr
  • Check if elements of this Series are in the right Series, or List values of the right Series.

    example
    >>> df = pl.DataFrame({
    ... "sets": [[1, 2, 3], [1, 2], [9, 10]],
    ... "optional_members": [1, 2, 3]
    ... })
    >>> df.select(
    ... pl.col("optional_members").isIn("sets").alias("contains")
    ... )
    shape: (3, 1)
    ┌──────────┐
    contains
    │ --- │
    bool
    ╞══════════╡
    true
    ├╌╌╌╌╌╌╌╌╌╌┤
    true
    ├╌╌╌╌╌╌╌╌╌╌┤
    false
    └──────────┘

    Parameters

    • other: any

      Series of primitive type or List type.

    Returns Expr

    Expr that evaluates to a Boolean Series.

  • Create a boolean expression returning true where the expression values are NaN (Not A Number).

    Returns Expr

  • Create a boolean expression returning true where the expression values are not NaN (Not A Number).

    Returns Expr

  • Create a boolean expression returning true where the expression does not contain null values.

    Returns Expr

  • Keep the original root name of the expression.

    A groupby aggregation often changes the name of a column. With keepName we can keep the original name of the column

    example
    >>> df = pl.DataFrame({
    ... "a": [1, 2, 3],
    ... "b": ["a", "b", None],
    ... })

    >>> df
    ... .groupBy("a")
    ... .agg(pl.col("b").list())
    ... .sort({by:"a"})

    shape: (3, 2)
    ╭─────┬────────────╮
    ab_agg_list
    │ --- ┆ --- │
    i64list [str] │
    ╞═════╪════════════╡
    1 ┆ [a] │
    ├╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┤
    2 ┆ [b] │
    ├╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┤
    3 ┆ [null] │
    ╰─────┴────────────╯

    Keep the original column name:

    >>> df
    ... .groupby("a")
    ... .agg(col("b").list().keepName())
    ... .sort({by:"a"})

    shape: (3, 2)
    ╭─────┬────────────╮
    ab
    │ --- ┆ --- │
    i64list [str] │
    ╞═════╪════════════╡
    1 ┆ [a] │
    ├╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┤
    2 ┆ [b] │
    ├╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┤
    3 ┆ [null] │
    ╰─────┴────────────╯

    Returns Expr

  • kurtosis(): Expr
  • kurtosis(fisher: boolean, bias?: boolean): Expr
  • kurtosis(__namedParameters: { bias?: boolean; fisher?: boolean }): Expr
  • lessThan(rhs: any): Expr
  • lessThanEquals(rhs: any): Expr
  • ltEq(rhs: any): Expr
  • minus(rhs: any): Expr
  • modulo(rhs: any): Expr
  • multiplyBy(rhs: any): Expr
  • notEquals(rhs: any): Expr
  • or(other: any): Expr
  • over(by: ExprOrString, ...partitionBy: ExprOrString[]): Expr
  • Apply window function over a subgroup.

    This is similar to a groupby + aggregation + self join. Or similar to window functions in Postgres

    example
    >>> df = pl.DataFrame({
    ... "groups": [1, 1, 2, 2, 1, 2, 3, 3, 1],
    ... "values": [1, 2, 3, 4, 5, 6, 7, 8, 8],
    ... })
    >>> df.select(
    ... pl.col("groups").sum().over("groups")
    ... )
    ╭────────┬────────╮
    groupsvalues
    │ --- ┆ --- │
    i32i32
    ╞════════╪════════╡
    116
    ├╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤
    116
    ├╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤
    213
    ├╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤
    213
    ├╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤
    │ ... ┆ ... │
    ├╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤
    116
    ├╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤
    213
    ├╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤
    315
    ├╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤
    315
    ├╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤
    116
    ╰────────┴────────╯

    Parameters

    • by: ExprOrString
    • Rest ...partitionBy: ExprOrString[]

      Column(s) to partition by.

    Returns Expr

  • plus(rhs: any): Expr
  • pow(exponent: number): Expr
  • pow(__namedParameters: { exponent: number }): Expr
  • prefix(prefix: string): Expr
  • Add a prefix the to root column name of the expression.

    example
    >>> df = pl.DataFrame({
    ... "A": [1, 2, 3, 4, 5],
    ... "fruits": ["banana", "banana", "apple", "apple", "banana"],
    ... "B": [5, 4, 3, 2, 1],
    ... "cars": ["beetle", "audi", "beetle", "beetle", "beetle"],
    ... })
    shape: (5, 4)
    ╭─────┬──────────┬─────┬──────────╮
    AfruitsBcars
    │ --- ┆ --- ┆ --- ┆ --- │
    i64stri64str
    ╞═════╪══════════╪═════╪══════════╡
    1"banana"5"beetle"
    ├╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┤
    2"banana"4"audi"
    ├╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┤
    3"apple"3"beetle"
    ├╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┤
    4"apple"2"beetle"
    ├╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┤
    5"banana"1"beetle"
    ╰─────┴──────────┴─────┴──────────╯
    >>> df.select(
    ... pl.all().reverse().prefix("reverse_"),
    ... )
    shape: (5, 8)
    ╭───────────┬────────────────┬───────────┬──────────────╮
    reverse_Areverse_fruitsreverse_Breverse_cars
    │ --- ┆ --- ┆ --- ┆ --- │
    i64stri64str
    ╞═══════════╪════════════════╪═══════════╪══════════════╡
    5"banana"1"beetle"
    ├╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
    4"apple"2"beetle"
    ├╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
    3"apple"3"beetle"
    ├╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
    2"banana"4"audi"
    ├╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
    1"banana"5"beetle"
    ╰───────────┴────────────────┴───────────┴──────────────╯

    Parameters

    • prefix: string

    Returns Expr

  • quantile(quantile: number): Expr
  • rank(method?: RankMethod): Expr
  • rank(__namedParameters: { method: string }): Expr
  • reinterpret(signed?: boolean): Expr
  • reinterpret(__namedParameters: { signed: boolean }): Expr
  • Repeat the elements in this Series n times by dictated by the number given by by. The elements are expanded into a List

    Parameters

    • by: string | Expr

      Numeric column that determines how often the values will be repeated.

      The column will be coerced to UInt32. Give this dtype to make the coercion a no-op.

    Returns Expr

  • rollingMax(options: RollingOptions): Expr
  • rollingMax(windowSize: number, weights?: number[], minPeriods?: number[], center?: boolean): Expr
  • 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.


    Parameters

    • options: RollingOptions

    Returns Expr

  • Parameters

    • windowSize: number
    • Optional weights: number[]
    • Optional minPeriods: number[]
    • Optional center: boolean

    Returns Expr

  • rollingMean(options: RollingOptions): Expr
  • rollingMean(windowSize: number, weights?: number[], minPeriods?: number[], center?: boolean): Expr
  • Apply 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.


    Parameters

    • options: RollingOptions

    Returns Expr

  • Parameters

    • windowSize: number
    • Optional weights: number[]
    • Optional minPeriods: number[]
    • Optional center: boolean

    Returns Expr

  • rollingMedian(options: RollingOptions): Expr
  • rollingMedian(windowSize: number, weights?: number[], minPeriods?: number[], center?: boolean): Expr
  • Compute a rolling median

    Parameters

    • options: RollingOptions

    Returns Expr

  • Parameters

    • windowSize: number
    • Optional weights: number[]
    • Optional minPeriods: number[]
    • Optional center: boolean

    Returns Expr

  • rollingMin(options: RollingOptions): Expr
  • rollingMin(windowSize: number, weights?: number[], minPeriods?: number[], center?: boolean): Expr
  • Apply 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.


    Parameters

    • options: RollingOptions

    Returns Expr

  • Parameters

    • windowSize: number
    • Optional weights: number[]
    • Optional minPeriods: number[]
    • Optional center: boolean

    Returns Expr

  • rollingQuantile(options: RollingOptions & { interpolation?: Interpolation; quantile: number }): Expr
  • rollingQuantile(quantile: number, interpolation?: Interpolation, windowSize?: number, weights?: number[], minPeriods?: number[], center?: boolean): Expr
  • Compute a rolling quantile

    Parameters

    • options: RollingOptions & { interpolation?: Interpolation; quantile: number }

    Returns Expr

  • Parameters

    • quantile: number
    • Optional interpolation: Interpolation
    • Optional windowSize: number
    • Optional weights: number[]
    • Optional minPeriods: number[]
    • Optional center: boolean

    Returns Expr

  • rollingSkew(windowSize: number, bias?: boolean): Expr
  • rollingSkew(__namedParameters: { bias?: boolean; windowSize: number }): Expr
  • Compute a rolling skew

    Parameters

    • windowSize: number

      Size of the rolling window

    • Optional bias: boolean

      If false, then the calculations are corrected for statistical bias.

    Returns Expr

  • Parameters

    • __namedParameters: { bias?: boolean; windowSize: number }
      • Optional bias?: boolean
      • windowSize: number

    Returns Expr

  • rollingStd(options: RollingOptions): Expr
  • rollingStd(windowSize: number, weights?: number[], minPeriods?: number[], center?: boolean): Expr
  • 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.


    Parameters

    • options: RollingOptions

    Returns Expr

  • Parameters

    • windowSize: number
    • Optional weights: number[]
    • Optional minPeriods: number[]
    • Optional center: boolean

    Returns Expr

  • rollingSum(options: RollingOptions): Expr
  • rollingSum(windowSize: number, weights?: number[], minPeriods?: number[], center?: boolean): Expr
  • Apply 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.


    Parameters

    • options: RollingOptions

    Returns Expr

  • Parameters

    • windowSize: number
    • Optional weights: number[]
    • Optional minPeriods: number[]
    • Optional center: boolean

    Returns Expr

  • rollingVar(options: RollingOptions): Expr
  • rollingVar(windowSize: number, weights?: number[], minPeriods?: number[], center?: boolean): Expr
  • Compute 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.


    Parameters

    • options: RollingOptions

    Returns Expr

  • Parameters

    • windowSize: number
    • Optional weights: number[]
    • Optional minPeriods: number[]
    • Optional center: boolean

    Returns Expr

  • round(decimals: number): Expr
  • round(options: { decimals: number }): Expr
  • Round underlying floating point data by decimals digits.

    Similar functionality to javascript toFixed

    Parameters

    • decimals: number

      number of decimals to round by.

    Returns Expr

  • Parameters

    • options: { decimals: number }
      • decimals: number

    Returns Expr

  • sample(opts?: { n: number; seed?: number | bigint; withReplacement?: boolean }): Expr
  • sample(opts?: { frac: number; seed?: number | bigint; withReplacement?: boolean }): Expr
  • sample(n?: number, frac?: number, withReplacement?: boolean, seed?: number | bigint): Expr
  • Sample from this DataFrame by setting either n or frac.

    example
    >>> df = pl.DataFrame({
    >>> "foo": [1, 2, 3],
    >>> "bar": [6, 7, 8],
    >>> "ham": ['a', 'b', 'c']
    >>> })
    >>> df.sample({n: 2})
    shape: (2, 3)
    ╭─────┬─────┬─────╮
    foobarham
    │ --- ┆ --- ┆ --- │
    i64i64str
    ╞═════╪═════╪═════╡
    16"a"
    ├╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌┤
    38"c"
    ╰─────┴─────┴─────╯

    Parameters

    • Optional opts: { n: number; seed?: number | bigint; withReplacement?: boolean }
      • n: number
      • Optional seed?: number | bigint
      • Optional withReplacement?: boolean

    Returns Expr

  • Parameters

    • Optional opts: { frac: number; seed?: number | bigint; withReplacement?: boolean }
      • frac: number
      • Optional seed?: number | bigint
      • Optional withReplacement?: boolean

    Returns Expr

  • Parameters

    • Optional n: number
    • Optional frac: number
    • Optional withReplacement: boolean
    • Optional seed: number | bigint

    Returns Expr

  • serialize(format: "json" | "bincode"): Buffer
  • shift(periods?: number): Expr
  • shift(__namedParameters: { periods: number }): Expr
  • Shift the values by a given period and fill the parts that will be empty due to this operation

    Parameters

    • Optional periods: number

      number of places to shift (may be negative).

    Returns Expr

  • Parameters

    • __namedParameters: { periods: number }
      • periods: number

    Returns Expr

  • shiftAndFill(periods: number, fillValue: Expr): Expr
  • shiftAndFill(__namedParameters: { fillValue: Expr; periods: number }): Expr
  • Shift the values by a given period and fill the parts that will be empty due to this operation

    Parameters

    • periods: number

      Number of places to shift (may be negative).

    • fillValue: Expr

      Fill null values with the result of this expression.

    Returns Expr

  • Parameters

    • __namedParameters: { fillValue: Expr; periods: number }
      • fillValue: Expr
      • periods: number

    Returns Expr

  • skew(bias?: boolean): Expr
  • skew(__namedParameters: { bias: boolean }): Expr
  • 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.


    Parameters

    • Optional bias: boolean

      If False, then the calculations are corrected for statistical bias.

    Returns Expr

  • Parameters

    • __namedParameters: { bias: boolean }
      • bias: boolean

    Returns Expr

  • slice(offset: number | Expr, length: number | Expr): Expr
  • slice(__namedParameters: { length: number | Expr; offset: number | Expr }): Expr
  • sort(reverse?: boolean, nullsLast?: boolean): Expr
  • sort(__namedParameters: { nullsLast?: boolean; reverse?: boolean }): Expr
  • Sort this column. In projection/ selection context the whole column is sorted.

    Parameters

    • Optional reverse: boolean
      • false -> order from small to large.
      • true -> order from large to small.
    • Optional nullsLast: boolean

      If true nulls are considered to be larger than any valid value

    Returns Expr

  • Parameters

    • __namedParameters: { nullsLast?: boolean; reverse?: boolean }
      • Optional nullsLast?: boolean
      • Optional reverse?: boolean

    Returns Expr

  • sortBy(by: ExprOrString | ExprOrString[], reverse?: boolean | boolean[]): Expr
  • sortBy(options: { by: ExprOrString | ExprOrString[]; reverse?: boolean | boolean[] }): Expr
  • Sort this column by the ordering of another column, or multiple other columns. In projection/ selection context the whole column is sorted. If used in a groupby context, the groups are sorted.

    Parameters

    • by: ExprOrString | ExprOrString[]

      The column(s) used for sorting.

    • Optional reverse: boolean | boolean[]

      false -> order from small to large. true -> order from large to small.

    Returns Expr

  • Parameters

    • options: { by: ExprOrString | ExprOrString[]; reverse?: boolean | boolean[] }
      • by: ExprOrString | ExprOrString[]
      • Optional reverse?: boolean | boolean[]

    Returns Expr

  • suffix(suffix: string): Expr
  • Get sum value.

    note

    Dtypes in {Int8, UInt8, Int16, UInt16} are cast to Int64 before summing to prevent overflow issues.

    Returns Expr

  • tail(length?: number): Expr
  • tail(__namedParameters: { length: number }): Expr
  • takeEvery(n: number): Expr
  • toJSON(): string
  • toString(): string
  • unique(maintainOrder?: boolean | { maintainOrder: boolean }): Expr
  • Get the unique values of this expression;

    Parameters

    • Optional maintainOrder: boolean | { maintainOrder: boolean }

      Maintain order of data. This requires more work.

    Returns Expr

  • Returns a unit Series with the highest value possible for the dtype of this expression.

    Returns Expr

Generated using TypeDoc