0 branches
Tree
Top files
Clone with HTTPS:
README.md
x: fix It is recommended that vlang provide a data analysis tool library similar to Python Pandas (fixes #19355)
last Apr 23
1.02 KB
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
- Load tabular data from CSV strings or files.
- Access cells, rows, and columns by name.
- Select columns and filter rows.
- Sort by string or numeric column values.
- Count distinct column values.
- Calculate
sum,mean,min,max,median,stddev, anddescribesummaries for numeric columns.The API is experimental and may change while the module is underx.