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.8.tar.gz
(26.6 kB
view hashes)
Built Distribution
Close
Hashes for dataframe_api_compat-0.1.8.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc5b67acb841168a1ca6fb5d4f7bd72719f87c2a8259124f0ce64a9e3ded351f |
|
MD5 | 13d39ff1b303157abd42d2768435c2d3 |
|
BLAKE2b-256 | acf285eb91451facf55fe8ade35290e4279c720a3fb4b0e9ae60ecb79c77f297 |
Close
Hashes for dataframe_api_compat-0.1.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd1196b035d4141a2b9110fa87eb244af1afcf51cdb6ce6b0fa3e482d86ca21a |
|
MD5 | 72f7d5aae1ffb868074c93dfa5b3c5d0 |
|
BLAKE2b-256 | d53dbc1a77060fd3508606651a89cb8d61f535f93896697de171a4d89a025a25 |