Function DataFrame

  • Create an empty DataFrame

    Returns pl.DataFrame<any>

  • Create a DataFrame from a JavaScript object

    Type Parameters

    • T1 extends ArrayLike<pl.Series<any, string>>

    Parameters

    • data: T1

      object or array of data

    • Optionaloptions: DataFrameOptions

      options

    Returns pl.DataFrame<{
        [K in pl.Series<any, string> as K["name"]]: K
    }>

    data = {'a': [1n, 2n], 'b': [3, 4]}
    df = pl.DataFrame(data)
    df
    shape: (2, 2)
    ╭─────┬─────╮
    ab
    │ --- ┆ --- │
    u64i64
    ╞═════╪═════╡
    13
    ├╌╌╌╌╌┼╌╌╌╌╌┤
    24
    ╰─────┴─────╯
  • Type Parameters

    • T2 extends Record<string, ArrayLike<any>>

    Parameters

    • data: T2
    • Optionaloptions: DataFrameOptions

    Returns pl.DataFrame<{
        [K in string | number | symbol]: K extends string
            ? pl.Series<JsToDtype<T2[K<K>][number]>, K<K>>
            : never
    }>

  • Parameters

    • data: any
    • Optionaloptions: DataFrameOptions

    Returns pl.DataFrame<any>

Methods