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
Built Distribution
Close
Hashes for dataframe_api_compat-0.1.11.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8eeceac390bdef4779877511ff3d7f152d46979764d23ddc17a05af74a0b6ce4 |
|
MD5 | 01f2221cda0423d7348e34bb0c374b1c |
|
BLAKE2b-256 | 6ab634d3f0873574ef6a4c86fffb5b808a83bce846c185987c0da994ce6c8975 |
Close
Hashes for dataframe_api_compat-0.1.11-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1368939441d11e1d5a74d598ed5512e797b086fb788a65bfca562fe765bd7421 |
|
MD5 | 3a6913f2f19c1e661d6086d38506c744 |
|
BLAKE2b-256 | 5a062e2520c51580588ca2a0b16511a1efb5e8714f487931a6dc4e83248a6128 |