Tidy interface to polars
Project description
tidypolars
tidypolars is a data frame library built on top of the blazingly fast polars library that gives access to methods and functions familiar to R tidyverse users.
Installation
$ pip3 install tidypolars
Usage
import tidypolars as tp
from tidypolars import col
test_df = tp.tidyframe({'x': range(3), 'y': range(4, 7), 'z': ['a', 'a', 'b']})
(
test_df
.select('x', 'y', 'z')
.filter(col('x') < 4, col('y') > 1)
.arrange('x', 'y')
.mutate(double_x = col('x') * 2,
x_plus_y = col('x') + col('y'))
)
shape: (3, 5)
┌─────┬─────┬─────┬──────────┬──────────┐
│ x ┆ y ┆ z ┆ double_x ┆ x_plus_y │
│ --- ┆ --- ┆ --- ┆ --- ┆ --- │
│ i64 ┆ i64 ┆ str ┆ i64 ┆ i64 │
╞═════╪═════╪═════╪══════════╪══════════╡
│ 0 ┆ 4 ┆ "a" ┆ 0 ┆ 4 │
├╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┤
│ 1 ┆ 5 ┆ "a" ┆ 2 ┆ 6 │
├╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┤
│ 2 ┆ 6 ┆ "b" ┆ 4 ┆ 8 │
└─────┴─────┴─────┴──────────┴──────────┘
Contributing
Interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.
License
tidypolars
was created by Mark Fairbanks. It is licensed under the terms of the MIT license.
Credits
tidypolars
was created with cookiecutter
and the py-pkgs-cookiecutter
template.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tidypolars-0.1.3.tar.gz
(4.6 kB
view hashes)
Built Distribution
Close
Hashes for tidypolars-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 947766d61eac57521798b5f684ba013df7649162968f5a56d6dbaded95242a00 |
|
MD5 | a86b65199b195b8658cd9e08d749b7bc |
|
BLAKE2b-256 | 459b6aae11ac56eaa149506c87eaadecfa1eb8fd597f36d7d1547e3a4b5f7fc5 |