DataFrame is the heart of tsb: a
two-dimensional, column-oriented table where every column is a typed
Series. It mirrors pandas.DataFrame with a fully
strict TypeScript API.
Edit any code block below and press ▶ Run
(or Ctrl+Enter) to execute it live in your browser.
Three factory methods cover the most common shapes of input data:
fromColumns, fromRecords, and from2D.
Inspect the shape, dimensionality, size, and axes of a DataFrame.
Retrieve columns with col() (throws if missing),
get() (returns undefined), and check existence with has().
Select rows by position with head(), tail(),
iloc(), or by label with loc().
All mutation methods return a new
DataFrame — tsb is immutable. Use assign(), drop(),
select(), and rename().
Detect, drop, and fill null values across the entire DataFrame.
Column-wise aggregates: sum(), mean(),
min(), max(), count(), and the
all-in-one describe().
Sort rows by column values with sortValues() or by the
index with sortIndex().
Use apply() to run a function over columns (axis 0) or rows
(axis 1). Iterate with items() and iterrows().
Convert between DataFrames and plain JavaScript structures.
Use setIndex() and resetIndex() to manipulate
the row index.
Write your own tsb code below. All exports from tsb are available:
DataFrame, Series, Index, Dtype, and more.