Use ASCII characters to display table outlines.
Set False to revert to the standard UTF8_FULL_CONDENSED formatting style. Default: true
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 |
# └─────┴───────┘ +-----+-------+
Set the number of columns that are visible when displaying tables.
Optional
n: numberNumber of columns to display; if n < 0
(eg: -1), display all columns.
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).
Optional
active: booleantrue / false Default - true
--------
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.).
Optional
active: booleantrue / false Default - true
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 maximum width of a table in characters.
Maximum table width in characters; if n < 0 (eg: -1), display full width.
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 │
└─────┴─────┘
Configure polars; offers options for table formatting and more.