NIAOJoin Beta
Ecosystem

ncl

available

Niao Column Library

ML & Data

Overview

ncl is for when your data is tables, not tensors. Columns are stored in packed typed arrays (int, float, string) and operations run across whole columns in one native pass, similar to pandas/numpy, but inside Niao.

Load a CSV, filter rows, group by a key and aggregate, join two frames, or push results into SQLite. If you're doing ML on tabular data, ncl gets the data ready and nml trains on it.

  • Series & DataFrame
  • Vectorized ops
  • groupby & merge
  • SQLite bridge

Import

import
import "ncl"

Quick start

quick start
import "ncl"
let df = ncl.read_csv("sales.csv")
let summary = df.groupby("region").agg({ revenue: "sum", units: "mean" })
print(summary.head(5))

Capabilities

High-level overview of what ncl is for.

Series & DataFrame

A DataFrame is a set of named columns with a shared row index. Select columns, filter, sort, and slice rows the way you'd expect from pandas.

Vectorized ufuncs

Add two columns, compare values, run abs/sqrt/log across an entire column, one call, no Python-style row loops.

groupby & merge

Split on a key column and aggregate (sum, mean, count, etc.). Join frames on shared keys with inner, left, or outer semantics.

CSV I/O

Read and write CSV with configurable delimiters and headers. Type inference on load so numbers stay numbers.

SQLite bridge

Run a query through nsqlite and land the result directly in a DataFrame, or write a frame back to a table.

API reference

47 functions and methods in ncl. Grouped by category from the standard library docs.

numpy-like arrays

SignatureDescription
ncl.zeros(n, as_float?)Zero-filled packed array
ncl.ones(n, as_float?)Ones-filled packed array
ncl.arange(start, stop, step?)Integer range → `IntArray`
ncl.linspace(start, stop, n)Evenly spaced floats → `FloatArray`
ncl.array(data)Homogeneous array from Niao array literal
ncl.slice(arr, start, end)Zero-copy-style slice (new buffer)
ncl.add(a, b)Element-wise ops on packed arrays
ncl.sub(a, b)Element-wise ops on packed arrays
ncl.mul(a, b)Element-wise ops on packed arrays
ncl.div(a, b)Element-wise ops on packed arrays
ncl.abs / sqrt / exp / log / sin / cosUnary math ufuncs
ncl.sum / mean / min / max / std / var / medianReductions
ncl.corr(a, b)Pearson correlation
ncl.dot(a, b)Dot product
ncl.parallel_sum(arr)Rayon parallel sum (large arrays)

Series & DataFrame

SignatureDescription
ncl.series(data, name?)1D column from packed array
ncl.dataframe({col: array, …})Aligned multi-column table
ncl.df_get(df, name)Column as Series
ncl.df_set(df, name, array)Assign/replace column
ncl.df_columns(df)Column name list
ncl.df_shape(df)`[rows, cols]`
ncl.series_values(s)Packed array backing
ncl.head(df, n?)Row slice
ncl.tail(df, n?)Row slice
ncl.filter(df, mask)Boolean/int mask select
ncl.sort_values(df, col, desc?)Sort by column

Analytics

SignatureDescription
ncl.groupby(df, key)Split by int/string key column
ncl.agg(group, {col: "sum"\"mean"\
ncl.merge(left, right, on)Inner join on int key
ncl.concat(a, b)Vertical stack
ncl.pivot(df, index, columns, values)Pivot table
ncl.melt(df, id_vars)Wide → long

Missing values & rolling

SignatureDescription
ncl.isna(series)Null mask
ncl.fillna(series, value)Fill nulls
ncl.dropna(series)Remove null rows
ncl.rolling_mean(s, window)Sliding mean
ncl.rolling_sum / rolling_stdSliding sum / std
ncl.describe(series)count, mean, std, min, max

I/O

SignatureDescription
ncl.read_csv(path)Typed CSV → DataFrame
ncl.to_csv(df, path?)Write file or return string
ncl.from_sqlite(conn, sql, params?)Packed columns from nsqlite
ncl.to_datetime(series, format?)Parse string column to epoch ms

NDArray

SignatureDescription
ncl.ndarray(shape, data)N-dimensional homogeneous array
ncl.shape(arr)Shape ops
ncl.dtype(arr)Shape ops
ncl.reshape(arr)Shape ops
ncl.flatten(arr)Shape ops

Related libraries

More from ML & Data.

available

nml

Niao Machine Learning

Machine learning in Niao: tensors, training loops, classic algorithms, and graph models. Heavy math runs in Rust (SIMD on CPU, CUDA optional).

  • Tensors & autograd
  • Training loops
  • k-means & trees
  • GCN / GraphSAGE
Read more
available

nvis

Niao Visualization

Charts for training runs and quick data checks. Save SVG or print ASCII in the terminal, no browser needed.

  • Line & scatter
  • Histograms & heatmaps
  • SVG export
  • Training loss plots
Read more