API Reference / cli /

read_data.py

Read Data Command - Preview actual rows from a dataset.

Functions

Command

tuiml read-data

Line 16
tuiml read-data [OPTIONS]

Preview actual rows from a dataset.

Returns real rows as a list of records, so you can eyeball the values, column names and encodings without loading the file yourself. Rows can be taken from the head or the tail, drawn as a random sample, or picked out by index, and --columns narrows the output down to a few fields. The label column comes along unless you pass --no-include-target.

Preview the first rows of a built-in dataset:

bash
$ tuiml read-data --data iris

Draw a random sample of five rows:

bash
$ tuiml read-data --data data.csv --mode sample --n-rows 5

Pull out specific rows by index:

bash
$ tuiml read-data --data data.csv --mode indices --indices '[0,7]'

Options

--data
str required
Data file path or built-in dataset name (e.g., 'iris', '/tmp/tuiml_preprocessed/file.csv')
--n-rows
int
Number of rows to return (default: 10, max: 100)
--mode
str
Which rows to return: 'head' (first n-rows, the default), 'tail' (last n-rows), 'sample' (random n-rows), or 'indices' (the rows listed in --indices)
--indices
str
Row indices to return as a JSON array, e.g. '[0, 7, 42]'. Only used when --mode indices
--columns
str
Columns to return as a JSON array, e.g. '["age", "income"]'. Returns all columns if omitted
--include-target/--no-include-target
= True
Include the target column in the output (default: True)
--target
str
Target column name (used to label the target in the output)
--json-output
flag
Output raw JSON