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.9.tar.gz
(28.9 kB
view hashes)
Built Distribution
Close
Hashes for dataframe_api_compat-0.1.9.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c60e128d5590b6549f9806d9908beee92731f2f3f611532070e35a144eb1286 |
|
MD5 | 916baa709f32a3add86484382daf2f2f |
|
BLAKE2b-256 | 3378f73e0b766645601b5bf2658c9d8a2a90aa5f7122c02730de0283ab231ba7 |
Close
Hashes for dataframe_api_compat-0.1.9-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9c189cb8fc79c9888639378801729b36986b0a49e24aa8332f9189eb1f03c5c |
|
MD5 | 83551094db8c8d2aa0298fa874868e69 |
|
BLAKE2b-256 | 225be9da6f32d96226e5eef551fff9a14046b15c9ac5139691f7ef779968aff4 |