Implementation of the DataFrame Standard for pandas and Polars
Project description
DataFrame API Compat
Implementation of the DataFrame Standard for pandas and polars.
What's this?
Please read our blog post! https://data-apis.org/blog/dataframe_standard_rfc/.
Documentation
Please check https://data-apis.org/dataframe-api/draft/API_specification/index.html for the methods supported by the Consortium Dataframe Standard.
How to try this out
Here's an example of how you can try this out:
import polars as pl
df = pl.DataFrame({'a': [1,2,3]})
df_std = df.__dataframe_consortium_standard__()
The object df_std
is a Standard-compliant DataFrame. Check the
API Specification
for the full list of methods supported on it.
Compliance with the Standard
This is mostly compliant. Notable differences:
-
for pandas numpy dtypes, the null values (NaN) don't follow Kleene logic;
-
for polars lazy, columns can only be used within the context of the same dataframe. For example:
Not allowed:
mask = df2.get_column_by_name('a') > 0 df1.filter(mask)
Allowed:
mask = df1.get_column_by_name('a') > 0 df1.filter(mask)
-
for polars lazy, comparisons between different dataframes are not implemented.
Installation
pip install dataframe-api-compat
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
Hashes for dataframe_api_compat-0.1.16.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | da7b52472957fb45466bf723450e3d57453addb80f1f36206e133ab6538d1c0a |
|
MD5 | 19a3ec0c1686aa69fb602f0e0909c7dc |
|
BLAKE2b-256 | 7b505e4b32fb597a93d62e1af13c748553ca8d7f67556ed9b60eb902dc02d586 |
Hashes for dataframe_api_compat-0.1.16-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c49dffdc5dbad53a63e60373caa954d11bdec97a4d08ebd61f72b5575a3964c0 |
|
MD5 | e168d967cd6a3b0b1b20191ee44a090f |
|
BLAKE2b-256 | 02abdc61fc7f167261b3aa5ca9798b8cbacee7ab3894725c586ee4aa9c8d5d91 |