Implementation of the DataFrame Standard for pandas and polars
Project description
DataFrame API Compat
Implementation of the DataFrame Standard for pandas and polars-eager
Note: there is ongoing discussion about lazy engines in the Standard. Until that has been resolved, this package should not be relied upon for polars-lazy.
What's this?
Please read our blog post! https://data-apis.org/blog/dataframe_standard_rfc/.
How to try this out
Here's an example of how you can try this out:
import pandas as pd
from dataframe_api_compat import pandas_standard
from dataframe_api_compat import polars_standard
def convert_to_standard_compliant_dataframe(df):
if isinstance(df, pd.DataFrame):
return pandas_standard.convert_to_standard_compliant_dataframe(df)
elif isinstance(df, pl.DataFrame):
return polars_standard.convert_to_standard_compliant_dataframe(df)
else:
raise TypeError(f"Got unexpected type: {type(df)}")
df = pd.DataFrame({'a': [1,2,3]})
df_std = convert_to_standard_compliant_dataframe(df)
The object df_std
is a Standard-compliant DataFrame.
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
dataframe_api_compat-0.1.7.tar.gz
(13.1 kB
view hashes)
Built Distribution
Close
Hashes for dataframe_api_compat-0.1.7.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1100944fb4e109b1432800b1f17be256f6672dd7f87a307e5c95cb557fbc1858 |
|
MD5 | 4dfd662aa06531cbcf2f89942e06a477 |
|
BLAKE2b-256 | 18fd5f43ca6e86e2e6c9b751ee76474a5c011eae66fad9b0ee40af30d4409863 |
Close
Hashes for dataframe_api_compat-0.1.7-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d079c25e6b1f8ad504f112d732ac47377ef5204bf6c1f84dc3e10375d58422d6 |
|
MD5 | 6b74dfd483a3017dd8deab98b1487f28 |
|
BLAKE2b-256 | 0f4b26b6c2652543bc45c163d344c682238f3c3d7c9590a80d1d9980dd1efa9a |