0 branches
Tree Top files
Code
Clone with HTTPS:
56 years ago
..

DataFrame

x.dataframe provides a small experimental tabular data API. It is intended as a foundation for data analysis workflows that need DataFrame-style operations without leaving V.

The module stores cells as strings and provides numeric helpers on Series for common analysis tasks.

import x.dataframe

const prices = 'symbol,price,qty
AAPL,189.5,2
MSFT,420.25,3
'

fn main() {
    df := dataframe.from_csv(prices, dataframe.CsvConfig{})!
    println(df.shape())

    price := df.column('price')!
    println(price.mean()!)

    liquid := df.filter(fn (row dataframe.Row) bool {
        return row.values['qty'].int() >= 3
    })
    println(liquid.rows)
}

Features