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-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/.

Documentation

Please check https://data-apis.org/dataframe-api/draft/API_specification/index.html for the methods supported by the Consortium Dataframe Standard.

How to try this out

Here's an example of how you can try this out:

import polars as pl

df = pl.DataFrame({'a': [1,2,3]})
df_std = df.__dataframe_consortium_standard__()

The object df_std is a Standard-compliant DataFrame. Check the API Specification for the full list of methods supported on it.

Compliance with the Standard

This is mostly compliant. Notable differences:

  • for pandas numpy dtypes, the null values (NaN) don't follow Kleene logic;
  • for polars lazy, column reductions (e.g. column.mean()) are not implemented;
  • for polars lazy, comparisons between different dataframes are not implemented.

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.12.tar.gz (30.1 kB view hashes)

Uploaded Source

Built Distribution

dataframe_api_compat-0.1.12-py3-none-any.whl (16.7 kB view hashes)

Uploaded Python 3

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