nodejs-polars
    Preparing search index...

    Interface Config

    Configure polars; offers options for table formatting and more.

    interface Config {
        setAsciiTables(active: boolean): pl.Config;
        setAsciiTables(): pl.Config;
        setTblCols(n?: number): pl.Config;
        setTblColumnDataTypeInline(active?: boolean): pl.Config;
        setTblHideColumnDataTypes(active?: boolean): pl.Config;
        setTblRows(n: number): pl.Config;
        setTblRows(): pl.Config;
        setTblWidthChars(width: number): pl.Config;
        setTblWidthChars(): pl.Config;
        setThousandsSeparator(separator?: string | boolean): pl.Config;
        setVerbose(active?: boolean): pl.Config;
    }
    Index
    • Use ASCII characters to display table outlines.

      Parameters

      • active: boolean

        Set False to revert to the standard UTF8_FULL_CONDENSED formatting style. Default: true

      Returns pl.Config

      const df = pl.DataFrame({abc: [1.0, 2.5, 5.0], xyz: [true, false, true]})
      pl.Config.setAsciiTables(true)

      # shape: (3, 2) shape: (3, 2)
      # ┌─────┬───────┐ +-----+-------+
      # │ abc ┆ xyz │ | abc | xyz |
      # │ --- ┆ --- │ | --- | --- |
      # │ f64 ┆ bool │ | f64 | bool |
      # ╞═════╪═══════╡ +=============+
      # │ 1.0 ┆ true │ >> | 1.0 | true |
      # │ 2.5 ┆ false │ | 2.5 | false |
      # │ 5.0 ┆ true │ | 5.0 | true |
      # └─────┴───────┘ +-----+-------+
    • Returns pl.Config

    • Set the number of columns that are visible when displaying tables.

      Parameters

      • Optionaln: number

        Number of columns to display; if n < 0 (eg: -1), display all columns.

      Returns pl.Config

      const df = pl.DataFrame( {abc: [1.0, 2.5, 3.5, 5.0], def: ["d", "e", "f", "g"], xyz: [true, false, true, false] } );
      // Set number of displayed columns to a low value
      pl.Config.setTblCols(2);

      shape: (4, 3)
      ┌─────┬───┬───────┐
      │ abc ┆ … ┆ xyz │
      │ --- ┆ ┆ --- │
      │ f64 ┆ ┆ bool │
      ╞═════╪═══╪═══════╡
      │ 1.0 ┆ … ┆ true │
      │ 2.5 ┆ … ┆ false │
      │ 3.5 ┆ … ┆ true │
      │ 5.0 ┆ … ┆ false │
      └─────┴───┴───────┘
    • Display the data type next to the column name (to the right, in parentheses).

      Parameters

      • Optionalactive: boolean

        true / false Default - true

      Returns pl.Config

      --------
      const df = pl.DataFrame({abc: [1.0, 2.5, 5.0], xyz: [true, false, true]})
      pl.Config.setTblColumnDataTypeInline(true)

      # shape: (3, 2) shape: (3, 2)
      # ┌─────┬───────┐ ┌───────────┬────────────┐
      # │ abc ┆ xyz │ │ abc (f64) ┆ xyz (bool) │
      # │ --- ┆ --- │ ╞═══════════╪════════════╡
      # │ f64 ┆ bool │ │ 1.0 ┆ true │
      # ╞═════╪═══════╡ >> │ 2.5 ┆ false │
      # │ 1.0 ┆ true │ │ 5.0 ┆ true │
      # │ 2.5 ┆ false │ └───────────┴────────────┘
      # │ 5.0 ┆ true │
      # └─────┴───────┘
    • Hide table column data types (i64, f64, str etc.).

      Parameters

      • Optionalactive: boolean

        true / false Default - true

      Returns pl.Config

      const df = pl.DataFrame({abc: [1.0, 2.5, 5.0], xyz: [true, false, true]})
      pl.Config.setTblHideColumnDataTypes(true)

      # shape: (3, 2) shape: (3, 2)
      # ┌─────┬───────┐ ┌─────┬───────┐
      # │ abc ┆ xyz │ │ abc ┆ xyz │
      # │ --- ┆ --- │ ╞═════╪═══════╡
      # │ f64 ┆ bool │ │ 1.0 ┆ true │
      # ╞═════╪═══════╡ >> │ 2.5 ┆ false │
      # │ 1.0 ┆ true │ │ 5.0 ┆ true │
      # │ 2.5 ┆ false │ └─────┴───────┘
      # │ 5.0 ┆ true │
      # └─────┴───────┘
    • Set the max number of rows used to draw the table (both Dataframe and Series).

      Parameters

      • n: number

        Number of rows to display; if n < 0 (eg: -1), display all rows (DataFrame) and all elements (Series).

      Returns pl.Config

      const df = pl.DataFrame({abc: [1.0, 2.5, 5.0], xyz: [true, false, true]})
      pl.Config.setTblRows(2);

      shape: (4, 2)
      ┌─────┬───────┐
      │ abc ┆ xyz │
      │ --- ┆ --- │
      │ f64 ┆ bool │
      ╞═════╪═══════╡
      │ 1.0 ┆ true │
      │ … ┆ … │
      │ 5.0 ┆ false │
      └─────┴───────┘
    • Returns pl.Config

    • Set the maximum width of a table in characters.

      Parameters

      • width: number

        Maximum table width in characters; if n < 0 (eg: -1), display full width.

      Returns pl.Config

      const df = pl.DataFrame({ id: ["SEQ1", "SEQ2"], seq: ["ATGATAAAGGAG", "GCAACGCATATA"] });
      >>> df
      shape: (2, 2)
      ┌──────┬──────────────┐
      │ id ┆ seq │
      │ --- ┆ --- │
      │ str ┆ str │
      ╞══════╪══════════════╡
      │ SEQ1 ┆ ATGATAAAGGAG │
      │ SEQ2 ┆ GCAACGCATATA │
      └──────┴──────────────┘
      >>> pl.Config.setTblWidthChars(12);
      >>> df
      shape: (2, 2)
      ┌─────┬─────┐
      │ id ┆ seq │
      │ --- ┆ --- │
      │ str ┆ str │
      ╞═════╪═════╡
      │ SEQ ┆ ATG │
      │ 1 ┆ ATA │
      │ ┆ AAG │
      │ ┆ GAG │
      │ SEQ ┆ GCA │
      │ 2 ┆ ACG │
      │ ┆ CAT │
      │ ┆ ATA │
      └─────┴─────┘
    • Returns pl.Config

    • Set the thousands grouping separator character.

      Parameters

      • Optionalseparator: string | boolean

        : string | bool Set True to use the default "," (thousands) and "." (decimal) separators. Can also set a custom char, or set None to omit the separator.

      Returns pl.Config

    • Enable additional verbose/debug logging.

      Parameters

      • Optionalactive: boolean

        true / false Default - true

      Returns pl.Config