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/.
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.5.tar.gz
(12.7 kB
view hashes)
Built Distribution
Close
Hashes for dataframe_api_compat-0.1.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 44ee8145b1969cddb1559b06463e21263fe8de702c7ab3de1bda5785722ae806 |
|
MD5 | 6e2a6c27c50865c53b564f13d5c38fa5 |
|
BLAKE2b-256 | 687c0b8d567fd67934e1a7e9d856386dbf20677f690c32ef1319b3fb2947e8c6 |
Close
Hashes for dataframe_api_compat-0.1.5-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79819e17adb8ff5b23153f946ba892bdb39952248e5db7e2ef0c2fea32d470a7 |
|
MD5 | 7d90f195f0ebc3e27962973e3bf58299 |
|
BLAKE2b-256 | 1c1297947f2cb5567214c1d20a3fc75a211836c07da6f9c20efc798df3bf7f87 |