nodejs-polars
    Preparing search index...

    Interface Series<T, Name>

    A Series represents a single column in a polars DataFrame.

    interface Series<T extends DataType = any, Name extends string = string> {
        "[inspect]"(): string;
        "[iterator]"(): IterableIterator<DTypeToJs<T>>;
        abs(): pl.Series<T, Name>;
        add(other: any): pl.Series;
        alias<U extends string>(name: U): pl.Series<T, U>;
        append(other: pl.Series): void;
        argMax(): Optional<number>;
        argMin(): Optional<number>;
        argSort(): pl.Series<T, Name>;
        argSort(descending?: boolean, nullsLast?: boolean): pl.Series<T, Name>;
        argSort(
            __namedParameters: { descending?: boolean; nullsLast?: boolean },
        ): pl.Series<T, Name>;
        argSort(
            __namedParameters: { nullsLast?: boolean; reverse?: boolean },
        ): pl.Series<T, Name>;
        argTrue(): pl.Series<T, Name>;
        argUnique(): pl.Series<T, Name>;
        as<U extends string>(name: string): pl.Series<T, U>;
        bitand(other: pl.Series<T>): pl.Series<T, Name>;
        bitor(other: pl.Series<T>): pl.Series<T, Name>;
        bitxor(other: pl.Series<T>): pl.Series<T, Name>;
        cast<const U extends DataType>(dtype: U, strict?: boolean): pl.Series<U>;
        cast(dtype: DataType, strict?: boolean): pl.Series;
        ceil(): pl.Series;
        chunkLengths(): T[];
        clip(min: number, max: number): pl.Series;
        clip(options: { max: number; min: number }): any;
        clone(): pl.Series<T, Name>;
        concat(other: pl.Series<T>): pl.Series<T, Name>;
        cumCount(reverse?: boolean): pl.Series;
        cumCount(__namedParameters: { reverse: boolean }): pl.Series;
        cumMax(reverse?: boolean): pl.Series;
        cumMax(__namedParameters: { reverse: boolean }): pl.Series;
        cumMin(reverse?: boolean): pl.Series;
        cumMin(__namedParameters: { reverse: boolean }): pl.Series;
        cumProd(reverse?: boolean): pl.Series;
        cumProd(__namedParameters: { reverse: boolean }): pl.Series;
        cumSum(reverse?: boolean): pl.Series;
        cumSum(__namedParameters: { reverse: boolean }): pl.Series;
        date: DatetimeSeries;
        describe(): pl.DataFrame;
        diff(n: number, nullBehavior: "ignore" | "drop"): pl.Series<T, Name>;
        diff(
            __namedParameters: { n: number; nullBehavior: "ignore" | "drop" },
        ): pl.Series<T, Name>;
        div(other: any): pl.Series;
        divideBy(other: any): pl.Series;
        dot(other: pl.Series): undefined | null | number;
        dropNulls(): pl.Series<T, Name>;
        dtype: T;
        eq(other: any): pl.Series;
        equals(other: any): pl.Series;
        ewmMean(): pl.Series;
        ewmMean(
            alpha?: number,
            adjust?: boolean,
            minPeriods?: number,
            bias?: boolean,
            ignoreNulls?: boolean,
        ): pl.Series;
        ewmMean(
            opts: {
                adjust?: boolean;
                alpha?: number;
                bias?: boolean;
                ignoreNulls?: boolean;
                minPeriods?: number;
            },
        ): pl.Series;
        ewmStd(): pl.Series;
        ewmStd(
            alpha?: number,
            adjust?: boolean,
            minPeriods?: number,
            bias?: boolean,
            ignoreNulls?: boolean,
        ): pl.Series;
        ewmStd(
            opts: {
                adjust?: boolean;
                alpha?: number;
                bias?: boolean;
                ignoreNulls?: boolean;
                minPeriods?: number;
            },
        ): pl.Series;
        ewmVar(): pl.Series;
        ewmVar(
            alpha?: number,
            adjust?: boolean,
            minPeriods?: number,
            bias?: boolean,
            ignoreNulls?: boolean,
        ): pl.Series;
        ewmVar(
            opts: {
                adjust?: boolean;
                alpha?: number;
                bias?: boolean;
                ignoreNulls?: boolean;
                minPeriods?: number;
            },
        ): pl.Series;
        explode(): any;
        extend(value: any, n: number): pl.Series;
        extendConstant(value: any, n: number): pl.Series;
        fillNull(
            strategy:
                | "max"
                | "mean"
                | "min"
                | "backward"
                | "forward"
                | "zero"
                | "one",
        ): pl.Series;
        fillNull(
            __namedParameters: {
                strategy:
                    | "max"
                    | "mean"
                    | "min"
                    | "backward"
                    | "forward"
                    | "zero"
                    | "one";
            },
        ): pl.Series;
        filter(predicate: pl.Series): pl.Series;
        filter(__namedParameters: { predicate: pl.Series }): pl.Series;
        floor(): pl.Series;
        gather(indices: number[]): pl.Series;
        gatherEvery(n: number, offset?: number): pl.Series;
        get(index: number): any;
        getIndex(n: number): any;
        greaterThan(other: any): pl.Series;
        greaterThanEquals(other: any): pl.Series;
        gt(other: any): pl.Series;
        gtEq(other: any): pl.Series;
        hash(
            k0?: number | bigint,
            k1?: number | bigint,
            k2?: number | bigint,
            k3?: number | bigint,
        ): pl.Series;
        hash(
            __namedParameters: {
                k0?: number | bigint;
                k1?: number | bigint;
                k2?: number | bigint;
                k3?: number | bigint;
            },
        ): pl.Series;
        hasValidity(): boolean;
        head(length?: number): pl.Series;
        inner(): any;
        interpolate(method?: InterpolationMethod): pl.Series;
        isBoolean(): boolean;
        isDateTime(): boolean;
        isDuplicated(): pl.Series;
        isFinite(): pl.Series;
        isFirstDistinct(): pl.Series;
        isFloat(): boolean;
        isIn<U>(other: pl.Series<any, string> | U[]): pl.Series;
        isInfinite(): pl.Series;
        isNotNull(): pl.Series;
        isNull(): pl.Series;
        isNumeric(): boolean;
        isString(): boolean;
        isUnique(): pl.Series;
        kurtosis(): Optional<number>;
        kurtosis(fisher: boolean, bias?: boolean): Optional<number>;
        kurtosis(
            __namedParameters: { bias?: boolean; fisher?: boolean },
        ): Optional<number>;
        len(): number;
        lessThan(other: any): pl.Series;
        lessThanEquals(other: any): pl.Series;
        limit(n?: number): pl.Series;
        lst: ListSeries;
        lt(other: any): pl.Series;
        ltEq(other: any): pl.Series;
        max(): number;
        mean(): number;
        median(): number;
        min(): number;
        minus(other: any): pl.Series;
        mode(): pl.Series;
        modulo(other: any): pl.Series;
        mul(other: any): pl.Series;
        multiplyBy(other: any): pl.Series;
        name: Name;
        nChunks(): number;
        neq(other: any): pl.Series;
        notEquals(other: any): pl.Series;
        nullCount(): number;
        nUnique(): number;
        peakMax(): pl.Series;
        peakMin(): pl.Series;
        plus(other: any): pl.Series;
        quantile(quantile: number, interpolation?: string): number;
        rank(method?: RankMethod, descending?: boolean): pl.Series;
        rechunk(): pl.Series;
        rechunk(inPlace: true): pl.Series;
        rechunk(inPlace: false): void;
        reinterpret(signed?: boolean): pl.Series;
        rem(other: any): pl.Series;
        rename(name: string): pl.Series;
        rename(name: string, inPlace: boolean): void;
        rename(__namedParameters: { inPlace?: boolean; name: string }): void;
        rename(__namedParameters: { inPlace: true; name: string }): void;
        rollingMax(options: RollingOptions): pl.Series;
        rollingMax(
            windowSize: number,
            weights?: number[],
            minPeriods?: number[],
            center?: boolean,
        ): pl.Series;
        rollingMean(options: RollingOptions): pl.Series;
        rollingMean(
            windowSize: number,
            weights?: number[],
            minPeriods?: number[],
            center?: boolean,
        ): pl.Series;
        rollingMedian(options: RollingOptions): pl.Series;
        rollingMedian(
            windowSize: number,
            weights?: number[],
            minPeriods?: number[],
            center?: boolean,
        ): pl.Series;
        rollingMin(options: RollingOptions): pl.Series;
        rollingMin(
            windowSize: number,
            weights?: number[],
            minPeriods?: number[],
            center?: boolean,
        ): pl.Series;
        rollingQuantile(options: RollingQuantileOptions): pl.Series;
        rollingQuantile(
            quantile: number,
            interpolation?: InterpolationMethod,
            windowSize?: number,
            weights?: number[],
            minPeriods?: number[],
            center?: boolean,
            by?: string,
            closed?: ClosedWindow,
        ): pl.Series;
        rollingSkew(windowSize: number, bias?: boolean): pl.Series;
        rollingSkew(options: RollingSkewOptions): pl.Series;
        rollingStd(options: RollingOptions): pl.Series;
        rollingStd(
            windowSize: number,
            weights?: number[],
            minPeriods?: number[],
            center?: boolean,
            ddof?: number,
        ): pl.Series;
        rollingSum(options: RollingOptions): pl.Series;
        rollingSum(
            windowSize: number,
            weights?: number[],
            minPeriods?: number[],
            center?: boolean,
        ): pl.Series;
        rollingVar(options: RollingOptions): pl.Series;
        rollingVar(
            windowSize: number,
            weights?: number[],
            minPeriods?: number[],
            center?: boolean,
            ddof?: number,
        ): pl.Series;
        round(decimals: number): pl.Series;
        round(options: { decimals: number }): pl.Series;
        sample(
            opts?: { n: number; seed?: number | bigint; withReplacement?: boolean },
        ): pl.Series;
        sample(
            opts?: {
                frac: number;
                seed?: number | bigint;
                withReplacement?: boolean;
            },
        ): pl.Series;
        sample(
            n?: number,
            frac?: number,
            withReplacement?: boolean,
            seed?: number | bigint,
        ): pl.Series;
        scatter(indices: pl.Series<any, string> | number[], value: any): void;
        serialize(format: "json" | "bincode"): Buffer;
        seriesEqual<U1>(
            other: pl.Series,
            nullEqual?: boolean,
            strict?: boolean,
        ): boolean;
        set(filter: pl.Series, value: any): pl.Series;
        shift(periods: number): pl.Series;
        shiftAndFill(periods: number, fillValue: number): pl.Series;
        shiftAndFill(args: { fillValue: number; periods: number }): pl.Series;
        shrinkToFit(): pl.Series;
        shrinkToFit(inPlace: true): void;
        skew(bias?: boolean): undefined | number;
        slice(start: number, length?: number): pl.Series;
        sort(): pl.Series;
        sort(options: { descending?: boolean; nullsLast?: boolean }): pl.Series;
        sort(options: { nullsLast?: boolean; reverse?: boolean }): pl.Series;
        str: StringSeries;
        struct: StructSeries;
        sub(other: any): pl.Series;
        sum(): number;
        tail(length?: number): pl.Series;
        toArray(): DTypeToJs<T>[];
        toDummies(separator?: string, dropFirst?: boolean): pl.DataFrame;
        toFrame(): pl.DataFrame;
        toJSON(): string;
        toObject(): {
            datatype: DtypeToJsName<T>;
            name: Name;
            values: DTypeToJs<T>[];
        };
        toTypedArray(): any;
        unique(maintainOrder?: boolean | { maintainOrder: boolean }): pl.Series;
        valueCounts(
            sort?: boolean,
            parallel?: boolean,
            name?: string,
            normalize?: boolean,
        ): pl.DataFrame;
        values(): IterableIterator<any>;
        zipWith(mask: pl.Series, other: pl.Series): pl.Series;
        readonly [n: number]: T;
    }

    Type Parameters

    • T extends DataType = any
    • Name extends string = string

    Hierarchy

    Indexable

    • readonly [n: number]: T
    Index

    Properties

    dtype: T
    name: Name
    struct: StructSeries

    Methods - Arithmetic

    Methods - Comparison

    Methods - Cumulative

    • Get an array with the cumulative max computes at every element.


      Parameters

      • Optionalreverse: boolean

        reverse the operation

      Returns pl.Series

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

      • __namedParameters: { reverse: boolean }

      Returns pl.Series

    • Get an array with the cumulative min computed at every element.


      Parameters

      • Optionalreverse: boolean

        reverse the operation

      Returns pl.Series

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

      • __namedParameters: { reverse: boolean }

      Returns pl.Series

    • Get an array with the cumulative product computed at every element.


      Parameters

      • Optionalreverse: boolean

        reverse the operation

      Returns pl.Series

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

      • __namedParameters: { reverse: boolean }

      Returns pl.Series

    • Get an array with the cumulative sum computed at every element.


      Parameters

      • Optionalreverse: boolean

        reverse the operation

      Returns pl.Series

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

      • __namedParameters: { reverse: boolean }

      Returns pl.Series

    Methods - Math

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

      Returns pl.Series

    • 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 pl.Series

    • Parameters

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

      Returns any

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

      Returns pl.Series

    • Round underlying floating point data by decimals digits.

      Similar functionality to javascript toFixed

      Parameters

      • decimals: number

        number of decimals to round by.

      Returns pl.Series

    • Parameters

      • options: { decimals: number }

      Returns pl.Series

    • Sample from this DataFrame by setting either n or frac.

      Parameters

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

      Returns pl.Series

      > 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

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

      Returns pl.Series

    • Parameters

      • Optionaln: number
      • Optionalfrac: number
      • OptionalwithReplacement: boolean
      • Optionalseed: number | bigint

      Returns pl.Series

    Methods - Other

    • Append a Series to this one.


      Parameters

      Returns void

      >  const s = pl.Series("a", [1, 2, 3])
      > const s2 = pl.Series("b", [4, 5, 6])
      > s.append(s2)
      shape: (6,)
      Series: 'a' [i64]
      [
      1
      2
      3
      4
      5
      6
      ]
    • __Quick summary statistics of a series. __

      Series with mixed datatypes will return summary statistics for the datatype of the first value.


      Returns pl.DataFrame

      >  const seriesNum = pl.Series([1,2,3,4,5])
      > series_num.describe()

      shape: (6, 2)
      ┌──────────────┬────────────────────┐
      statisticvalue
      │ --- ┆ --- │
      strf64
      ╞══════════════╪════════════════════╡
      "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)
      ┌──────────────┬───────┐
      statisticvalue
      │ --- ┆ --- │
      stri64
      ╞══════════════╪═══════╡
      "unique"4
      ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┤
      "null_count"1
      ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┤
      "count"5
      └──────────────┴───────┘
    • Compute the dot/inner product between two Series


      Parameters

      Returns undefined | null | number

      >  const s = pl.Series("a", [1, 2, 3])
      > const s2 = pl.Series("b", [4.0, 5.0, 6.0])
      > s.dot(s2)
      32.0
    • Exponentially-weighted moving average.

      Returns pl.Series

      Expr that evaluates to a float 64 Series.

      > const df = pl.DataFrame({a: [1, 2, 3]});
      > df.select(pl.col("a").ewmMean())
      shape: (3, 1)
      ┌──────────┐
      a
      | --- │
      f64
      ╞══════════╡
      1.0
      1.666667
      2.428571
      └──────────┘
    • Parameters

      • Optionalalpha: number
      • Optionaladjust: boolean
      • OptionalminPeriods: number
      • Optionalbias: boolean
      • OptionalignoreNulls: boolean

      Returns pl.Series

    • Parameters

      • opts: {
            adjust?: boolean;
            alpha?: number;
            bias?: boolean;
            ignoreNulls?: boolean;
            minPeriods?: number;
        }

      Returns pl.Series

    • Exponentially-weighted standard deviation.

      Returns pl.Series

      Expr that evaluates to a float 64 Series.

      > const df = pl.DataFrame({a: [1, 2, 3]});
      > df.select(pl.col("a").ewmStd())
      shape: (3, 1)
      ┌──────────┐
      a
      | --- │
      f64
      ╞══════════╡
      0.0
      0.707107
      0.963624
      └──────────┘
    • Parameters

      • Optionalalpha: number
      • Optionaladjust: boolean
      • OptionalminPeriods: number
      • Optionalbias: boolean
      • OptionalignoreNulls: boolean

      Returns pl.Series

    • Parameters

      • opts: {
            adjust?: boolean;
            alpha?: number;
            bias?: boolean;
            ignoreNulls?: boolean;
            minPeriods?: number;
        }

      Returns pl.Series

    • Exponentially-weighted variance.

      Returns pl.Series

      Expr that evaluates to a float 64 Series.

      > const df = pl.DataFrame({a: [1, 2, 3]});
      > df.select(pl.col("a").ewmVar())
      shape: (3, 1)
      ┌──────────┐
      a
      | --- │
      f64
      ╞══════════╡
      0.0
      0.5
      0.928571
      └──────────┘
    • Parameters

      • Optionalalpha: number
      • Optionaladjust: boolean
      • OptionalminPeriods: number
      • Optionalbias: boolean
      • OptionalignoreNulls: boolean

      Returns pl.Series

    • Parameters

      • opts: {
            adjust?: boolean;
            alpha?: number;
            bias?: boolean;
            ignoreNulls?: boolean;
            minPeriods?: number;
        }

      Returns pl.Series

    • Explode a list or utf8 Series.

      This means that every item is expanded to a new row.


      Returns any

      >  const s = pl.Series('a', [[1, 2], [3, 4], [9, 10]])
      > s.explode()
      shape: (6,)
      Series: 'a' [i64]
      [
      1
      2
      3
      4
      9
      10
      ]
    • 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 pl.Series

    • 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 pl.Series

    • Fill null values with a filling strategy.


      Parameters

      • strategy: "max" | "mean" | "min" | "backward" | "forward" | "zero" | "one"

        Filling Strategy

      Returns pl.Series

      >  const s = pl.Series("a", [1, 2, 3, None])
      > s.fill_null('forward'))
      shape: (4,)
      Series: '' [i64]
      [
      1
      2
      3
      3
      ]
      > s.fill_null('min'))
      shape: (4,)
      Series: 'a' [i64]
      [
      1
      2
      3
      1
      ]
    • Parameters

      • __namedParameters: { strategy: "max" | "mean" | "min" | "backward" | "forward" | "zero" | "one" }

      Returns pl.Series

    • Take values by index.


      Parameters

      • indices: number[]

        Index location used for the selection

      Returns pl.Series

      s = pl.Series("a", [1, 2, 3, 4])
      s.gather([1, 3])
      shape: (2,)
      Series: 'a' [i64]
      [
      2
      4
      ]
    • Take every nth value in the Series and return as new Series.

      Parameters

      • n: number

        Gather every n-th row

      • Optionaloffset: number

        Start the row count at this offset

      Returns pl.Series

      s = pl.Series("a", [1, 2, 3, 4])
      s.gatherEvery(2))
      shape: (2,)
      Series: 'a' [i64]
      [
      1
      3
      ]
      s.gather_every(2, offset=1)
      shape: (2,)
      Series: 'a' [i64]
      [
      2
      4
      ]
    • Hash the Series The hash value is of type UInt64


      Parameters

      • Optionalk0: number | bigint

        seed parameter

      • Optionalk1: number | bigint

        seed parameter

      • Optionalk2: number | bigint

        seed parameter

      • Optionalk3: number | bigint

        seed parameter

      Returns pl.Series

      >  const s = pl.Series("a", [1, 2, 3])
      > s.hash(42)
      shape: (3,)
      Series: 'a' [u64]
      [
      7499844439152382372
      821952831504499201
      6685218033491627602
      ]
    • Parameters

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

      Returns pl.Series

    • Returns True if the Series has a validity bitmask. If there is none, it means that there are no null values.

      Returns boolean

    • Get first N elements as Series.


      Parameters

      • Optionallength: number

        Length of the head

      Returns pl.Series

      >  const s = pl.Series("a", [1, 2, 3])
      > s.head(2)
      shape: (2,)
      Series: 'a' [i64]
      [
      1
      2
      ]
    • Get mask of all duplicated values.

      Returns pl.Series

      >  const s = pl.Series("a", [1, 2, 2, 3])
      > s.isDuplicated()

      shape: (4,)
      Series: 'a' [bool]
      [
      false
      true
      true
      false
      ]
    • Get mask of infinite values if Series dtype is Float.

      Returns pl.Series

      >  const s = pl.Series("a", [1.0, 2.0, 3.0])
      > s.isInfinite()

      shape: (3,)
      Series: 'a' [bool]
      [
      false
      false
      false
      ]
    • Get mask of non null values.

      undefined values are treated as null


      Returns pl.Series

      >  const s = pl.Series("a", [1.0, undefined, 2.0, 3.0, null])
      > s.isNotNull()
      shape: (5,)
      Series: 'a' [bool]
      [
      true
      false
      true
      true
      false
      ]
    • Get mask of null values.

      undefined values are treated as null


      Returns pl.Series

      >  const s = pl.Series("a", [1.0, undefined, 2.0, 3.0, null])
      > s.isNull()
      shape: (5,)
      Series: 'a' [bool]
      [
      false
      true
      false
      false
      true
      ]
    • Get mask of unique values.


      Returns pl.Series

      >  const s = pl.Series("a", [1, 2, 2, 3])
      > s.isUnique()
      shape: (4,)
      Series: 'a' [bool]
      [
      true
      false
      false
      true
      ]
    • Compute 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


      Returns Optional<number>

    • Parameters

      • fisher: boolean
      • Optionalbias: boolean

      Returns Optional<number>

    • Parameters

      • __namedParameters: { bias?: boolean; fisher?: boolean }

      Returns Optional<number>

    • Length of this Series.


      Returns number

      >  const s = pl.Series("a", [1, 2, 3])
      > s.len()
      3
    • Take n elements from this Series.


      Parameters

      • Optionaln: number

        Amount of elements to take.

      Returns pl.Series

      head

      s = pl.Series("a", [1, 2, 3])
      s.limit(2)
      shape: (2,)
      Series: 'a' [i64]
      [
      1
      2
      ]
    • Get the maximum value in this Series.

      Returns number

      > s = pl.Series("a", [1, 2, 3])
      > s.max()
      3
    • Reduce this Series to the mean value.

      Returns number

      > s = pl.Series("a", [1, 2, 3])
      > s.mean()
      2
    • Get the median of this Series

      Returns number

      > s = pl.Series("a", [1, 2, 3])
      > s.median()
      2
    • Get the minimal value in this Series.

      Returns number

      > s = pl.Series("a", [1, 2, 3])
      > s.min()
      1
    • Compute the most occurring value(s). Can return multiple Values


      Returns pl.Series

      s = pl.Series("a", [1, 2, 2, 3])
      s.mode()
      shape: (1,)
      Series: 'a' [i64]
      [
      2
      ]

      s = pl.Series("a", ['a', 'b', 'c', 'c', 'b'])
      s.mode()
      shape: (1,)
      Series: 'a' [str]
      [
      'b'
      'c'
      ]
    • Count the null values in this Series. -- undefined values are treated as null

      Returns number

    • Count the number of unique values in this Series.


      Returns number

      s = pl.Series("a", [1, 2, 2, 3])
      s.nUnique()
      3
    • Get a boolean mask of the local maximum peaks.


      Returns pl.Series

      s = pl.Series("a", [1, 2, 3, 4, 5])
      s.peakMax()
      shape: (5,)
      Series: '' [bool]
      [
      false
      false
      false
      false
      true
      ]
    • Get a boolean mask of the local minimum peaks.


      Returns pl.Series

      s = pl.Series("a", [4, 1, 3, 2, 5])
      s.peakMin()
      shape: (5,)
      Series: '' [bool]
      [
      false
      true
      false
      true
      false
      ]
    • Get the quantile value of this Series.


      Parameters

      • quantile: number
      • Optionalinterpolation: string

      Returns number

      s = pl.Series("a", [1, 2, 3])
      s.quantile(0.5)
      2
    • Assign ranks to data, dealing with ties appropriately. The method used to assign ranks to tied elements.

      Parameters

      • Optionalmethod: RankMethod

        {'average', 'min', 'max', 'dense', 'ordinal', 'random'} The following methods are available: default is 'average'

        • 'average': The average of the ranks that would have been assigned to all the tied values is assigned to each value.
        • 'min': The minimum of the ranks that would have been assigned to all the tied values is assigned to each value. This is also referred to as "competition" ranking.
        • 'max': The maximum of the ranks that would have been assigned to all the tied values is assigned to each value.
        • 'dense': Like 'min', but the rank of the next highest element is assigned the rank immediately after those assigned to the tied elements.
        • 'ordinal': All values are given a distinct rank, corresponding to the order that the values occur in a.
        • 'random': Like 'ordinal', but the rank for ties is not dependent on the order that the values occur in a.
      • Optionaldescending: boolean

        Rank in descending order.

      Returns pl.Series

    • 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.


      Parameters

      • Optionalsigned: boolean

        signed or unsigned

        • True -> pl.Int64
        • False -> pl.UInt64

      Returns pl.Series

      cast

    • Rename this Series.

      Parameters

      • name: string

        new name

      Returns pl.Series

      alias

      s = pl.Series("a", [1, 2, 3])
      s.rename('b')
      shape: (3,)
      Series: 'b' [i64]
      [
      1
      2
      3
      ]
    • Parameters

      • name: string
      • inPlace: boolean

      Returns void

    • Parameters

      • __namedParameters: { inPlace?: boolean; name: string }

      Returns void

    • Parameters

      • __namedParameters: { inPlace: true; name: string }

      Returns void

    • Serializes object to desired format via serde

      Parameters

      Returns Buffer

    • Check if series is equal with another Series.

      Type Parameters

      • U1

      Parameters

      • other: pl.Series

        Series to compare with.

      • OptionalnullEqual: boolean

        Consider null values as equal. ('undefined' is treated as null)


      • Optionalstrict: boolean

      Returns boolean

      s = pl.Series("a", [1, 2, 3])
      s2 = pl.Series("b", [4, 5, 6])
      s.series_equal(s)
      true
      s.series_equal(s2)
      false
    • Shift the values by a given period

      the parts that will be empty due to this operation will be filled with null.


      Parameters

      • periods: number

        Number of places to shift (may be negative).

      Returns pl.Series

      s = pl.Series("a", [1, 2, 3])
      s.shift(1)
      shape: (3,)
      Series: 'a' [i64]
      [
      null
      1
      2
      ]
      s.shift(-1)
      shape: (3,)
      Series: 'a' [i64]
      [
      2
      3
      null
      ]
    • Shift the values by a given period

      the parts that will be empty due to this operation will be filled with fillValue.


      Parameters

      • periods: number

        Number of places to shift (may be negative).

      • fillValue: number

        Fill null & undefined values with the result of this expression.

      Returns pl.Series

    • Parameters

      • args: { fillValue: number; periods: number }

      Returns pl.Series

    • 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.


      Parameters

      • Optionalbias: boolean

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

      Returns undefined | number

    • Sort this Series.

      Returns pl.Series

      options.reverse - Reverse/descending sort. Use param.descending instead

      s = pl.Series("a", [1, 3, 4, 2])
      s.sort()
      shape: (4,)
      Series: 'a' [i64]
      [
      1
      2
      3
      4
      ]
      s.sort({descending: true})
      shape: (4,)
      Series: 'a' [i64]
      [
      4
      3
      2
      1
      ]
    • Parameters

      • options: { descending?: boolean; nullsLast?: boolean }

      Returns pl.Series

    • Parameters

      • options: { nullsLast?: boolean; reverse?: boolean }

      Returns pl.Series

    • Reduce this Series to the sum value.

      Returns number

      > s = pl.Series("a", [1, 2, 3])
      > s.sum()
      6
    • Get last N elements as Series.


      Parameters

      • Optionallength: number

        Length of the tail

      Returns pl.Series

      head

      s = pl.Series("a", [1, 2, 3])
      s.tail(2)
      shape: (2,)
      Series: 'a' [i64]
      [
      2
      3
      ]
    • Convert this Series to a Javascript Array.

      This operation clones data, and is very slow, but maintains greater precision for all dtypes. Often times series.toObject().values is faster, but less precise


      Returns DTypeToJs<T>[]

      const s = pl.Series("a", [1, 2, 3])
      const arr = s.toArray()
      [1, 2, 3]
      Array.isArray(arr)
      true
    • Get dummy/indicator variables.

      Parameters

      • Optionalseparator: string
      • OptionaldropFirst: boolean

      Returns pl.DataFrame

      const s = pl.Series("a", [1, 2, 3])
      >>> s.toDummies()
      shape: (3, 3)
      ┌─────┬─────┬─────┐
      a_1a_2a_3
      │ --- ┆ --- ┆ --- │
      u8u8u8
      ╞═════╪═════╪═════╡
      100
      010
      001
      └─────┴─────┴─────┘

      >>> s.toDummies(":", true)
      shape: (3, 2)
      ┌─────┬─────┐
      a:2a:3
      │ --- ┆ --- │
      u8u8
      ╞═════╪═════╡
      00
      10
      01
      └─────┴─────┘
    • Returns a Javascript object representation of Series Often this is much faster than the iterator, or values method

      Returns { datatype: DtypeToJsName<T>; name: Name; values: DTypeToJs<T>[] }

      const s = pl.Series("foo", [1,2,3])
      s.toObject()
      {
      name: "foo",
      datatype: "Float64",
      values: [1,2,3]
      }
    • Converts series to a javascript typedArray.

      Warning: This will throw an error if you have nulls, or are using non numeric data types

      Returns any

    • Get unique elements in series.


      Parameters

      • OptionalmaintainOrder: boolean | { maintainOrder: boolean }

        Maintain order of data. This requires more work.

      Returns pl.Series

      s = pl.Series("a", [1, 2, 2, 3])
      s.unique()
      shape: (3,)
      Series: 'a' [i64]
      [
      1
      2
      3
      ]
    • Count the unique values in a Series.

      Parameters

      • Optionalsort: boolean

        Sort the output by count in descending order. If set to False (default), the order of the output is random.

      • Optionalparallel: boolean

        Execute 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.

      • Optionalname: string

        Give the resulting count column a specific name; if normalize is True defaults to "count", otherwise defaults to "proportion".

      • Optionalnormalize: boolean

        If true gives relative frequencies of the unique values


      Returns pl.DataFrame

      s = pl.Series("a", [1, 2, 2, 3])
      s.valueCounts()
      shape: (3, 2)
      ╭─────┬────────╮
      acounts
      │ --- ┆ --- │
      i64u32
      ╞═════╪════════╡
      22
      ├╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤
      11
      ├╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤
      31
      ╰─────┴────────╯

    Methods - Rolling

    • 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

      Returns pl.Series

    • Parameters

      • windowSize: number
      • Optionalweights: number[]
      • OptionalminPeriods: number[]
      • Optionalcenter: boolean

      Returns pl.Series

    • 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

      Returns pl.Series

    • Parameters

      • windowSize: number
      • Optionalweights: number[]
      • OptionalminPeriods: number[]
      • Optionalcenter: boolean

      Returns pl.Series

    • 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

      Returns pl.Series

    • Parameters

      • windowSize: number
      • Optionalweights: number[]
      • OptionalminPeriods: number[]
      • Optionalcenter: boolean

      Returns pl.Series

    • 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

      Returns pl.Series

    • Parameters

      • windowSize: number
      • Optionalweights: number[]
      • OptionalminPeriods: number[]
      • Optionalcenter: boolean
      • Optionalddof: number

      Returns pl.Series

    • 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

      Returns pl.Series

    • Parameters

      • windowSize: number
      • Optionalweights: number[]
      • OptionalminPeriods: number[]
      • Optionalcenter: boolean

      Returns pl.Series

    • 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

      Returns pl.Series

    • Parameters

      • windowSize: number
      • Optionalweights: number[]
      • OptionalminPeriods: number[]
      • Optionalcenter: boolean
      • Optionalddof: number

      Returns pl.Series