An extension to tidypolars4sci with additional functionalities for scientific data analysis.
Project description
tidypolars-extra
tidypolars-extra is an extension of tidypolars4sci, which provides Tidyverse-like functions for data manipulation and analysis in Python using Polars as the backend.
This project builds upon the original tidypolars4sci by adding extra functionalities and improvements while maintaining the same familiar API.
Features
- Tidyverse-style API for Polars DataFrames
- Scientific research utilities including LaTeX table generation
- Fast data manipulation powered by Polars
- Familiar R-like syntax for Python users
Installation
You can install tidypolars-extra with pip:
pip install tidypolars-extra
Basic usage
tidypolars-extra methods are designed to work like tidyverse functions:
import tidypolars_extra as tp
# create tibble data frame
df = tp.tibble(x = range(3),
y = range(3, 6),
z = ['a', 'a', 'b'])
(
df
.select('x', 'y', 'z')
.filter(tp.col('x') < 4, tp.col('y') > 1)
.arrange(tp.desc('z'), 'x')
.mutate(double_x = tp.col('x') * 2,
x_plus_y = tp.col('x') + tp.col('y')
)
)
┌─────┬─────┬─────┬──────────┬──────────┐
│ x ┆ y ┆ z ┆ double_x ┆ x_plus_y │
│ --- ┆ --- ┆ --- ┆ --- ┆ --- │
│ i64 ┆ i64 ┆ str ┆ i64 ┆ i64 │
╞═════╪═════╪═════╪══════════╪══════════╡
│ 2 ┆ 5 ┆ b ┆ 4 ┆ 7 │
├╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┤
│ 0 ┆ 3 ┆ a ┆ 0 ┆ 3 │
├╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┤
│ 1 ┆ 4 ┆ a ┆ 2 ┆ 5 │
└─────┴─────┴─────┴──────────┴──────────┘
Converting to/from pandas data frames
If you need to use a package that requires pandas or polars data frames, you can convert from a tidypolars_extra tibble to either of those DataFrame formats.
# convert to pandas...
df = df.to_pandas()
# ... or convert to polars
df = df.to_polars()
To convert from a pandas or polars DataFrame to a tidypolars tibble:
# convert from pandas...
df = tp.from_pandas(df)
# or covert from polars
df = tp.from_polars(df)
Acknowledgments
This project is an extension of:
- tidypolars4sci by Diogo Ferrari
- tidypolars — the original starting point
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tidypolars_extra-0.1.0.tar.gz.
File metadata
- Download URL: tidypolars_extra-0.1.0.tar.gz
- Upload date:
- Size: 684.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d1842119338d4f6788f64bf77ff700792db2c80a2a5ea223ef8cda85aa83e861
|
|
| MD5 |
124f656f15dc7d7d06cc883c9dbd3dca
|
|
| BLAKE2b-256 |
ee8e3f42849f42a3261c582e418f02d5c0cd26bab5835732307ba61a101504a3
|
Provenance
The following attestation bundles were made for tidypolars_extra-0.1.0.tar.gz:
Publisher:
publish.yml on mdmanurung/tidypolars-extra
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tidypolars_extra-0.1.0.tar.gz -
Subject digest:
d1842119338d4f6788f64bf77ff700792db2c80a2a5ea223ef8cda85aa83e861 - Sigstore transparency entry: 1244166507
- Sigstore integration time:
-
Permalink:
mdmanurung/tidypolars-extra@b3948d530643327da5ff491d0c4a9a37ac657ed0 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/mdmanurung
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b3948d530643327da5ff491d0c4a9a37ac657ed0 -
Trigger Event:
release
-
Statement type:
File details
Details for the file tidypolars_extra-0.1.0-py3-none-any.whl.
File metadata
- Download URL: tidypolars_extra-0.1.0-py3-none-any.whl
- Upload date:
- Size: 712.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0a5d22b93de50cf38435be9b36a38a81ae0555077b48d63d34f59be433bfb5c7
|
|
| MD5 |
8bf4f23a060081adaa73eb9ffe5cb4ff
|
|
| BLAKE2b-256 |
18e28af5cbe40d54a9aca271594f22a7206c471b65aebc3517c5786739a8e3e0
|
Provenance
The following attestation bundles were made for tidypolars_extra-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on mdmanurung/tidypolars-extra
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tidypolars_extra-0.1.0-py3-none-any.whl -
Subject digest:
0a5d22b93de50cf38435be9b36a38a81ae0555077b48d63d34f59be433bfb5c7 - Sigstore transparency entry: 1244166515
- Sigstore integration time:
-
Permalink:
mdmanurung/tidypolars-extra@b3948d530643327da5ff491d0c4a9a37ac657ed0 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/mdmanurung
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b3948d530643327da5ff491d0c4a9a37ac657ed0 -
Trigger Event:
release
-
Statement type: