Skip to content
/ polars Public
forked from pola-rs/polars

Dataframes powered by a multithreaded, vectorized query engine, written in Rust

License

Notifications You must be signed in to change notification settings

kszlim/polars

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Polars


In memory DataFrames in Rust

This is my mock up of DataFrames implemented in Rust, using Apache Arrow as backend.

WIP

Series

  • cast
  • take by index/ boolean mask
  • Rust iterators
  • append
  • aggregation: min, max, sum
  • arithmetic
  • comparison
  • find
  • sorting (can be done w/ iterators)

DataFrame

  • selection
  • join: inner, left
  • group by
  • concat (horizontal)
  • read csv
  • write csv
  • write json
  • read json
  • sorting

Data types

  • null
  • boolean
  • u32
  • i32
  • i64
  • f32
  • f64
  • utf-8
  • date
  • timestamp

Example

let s0 = Series::init("days", [0, 1, 2, 3, 4].as_ref());
let s1 = Series::init("temp", [22.1, 19.9, 7., 2., 3.].as_ref());
let temp = DataFrame::new_from_columns(vec![s0, s1]).unwrap();

let s0 = Series::init("days", [1, 2].as_ref());
let s1 = Series::init("rain", [0.1, 0.2].as_ref());
let rain = DataFrame::new_from_columns(vec![s0, s1]).unwrap();
let joined = temp.left_join(&rain, "days", "days");
println!("{}", joined.unwrap())
           days           temp           rain
            i32            f64            f64
            ---            ---            ---

              0           22.1           null
              1           19.9            0.1
              2              7            0.2
              3              2           null
              4              3           nul

About

Dataframes powered by a multithreaded, vectorized query engine, written in Rust

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 65.4%
  • Python 34.5%
  • Other 0.1%