Skip to main content

Implementation of the DataFrame Standard for pandas and polars

Project description

Build Status Coverage pre-commit.ci status

DataFrame API Compat

standard-compliant DataFrame

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


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.2.tar.gz (12.5 kB view details)

Uploaded Source

Built Distribution

dataframe_api_compat-0.1.2-py2.py3-none-any.whl (13.7 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file dataframe_api_compat-0.1.2.tar.gz.

File metadata

  • Download URL: dataframe_api_compat-0.1.2.tar.gz
  • Upload date:
  • Size: 12.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for dataframe_api_compat-0.1.2.tar.gz
Algorithm Hash digest
SHA256 b1801e6e84df5f00586617491b688bfa2fd746c0227f9ed98c33aa96d038e1d7
MD5 6ebf3b2cdb39cc3e421e123357f32dd9
BLAKE2b-256 ebd042a1ff78f9d471106d8f5bf41b6232e9bbf75f4f065cb330649e48d9423a

See more details on using hashes here.

File details

Details for the file dataframe_api_compat-0.1.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for dataframe_api_compat-0.1.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 1440ddb10ac9c57989c04f94eaa1bcdcab797de15d4d97620f9eeb935849b60b
MD5 61cd347c00bb093779a2587ed95c917a
BLAKE2b-256 e9bf5ae616b1e83fcbf000ec7c48e93eebc53f6958cfa35731468d8b621a9e70

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page