Skip to main content

Dataframe comparison in Python

Project description

DataComPy

PyPI - Python Version Ruff PyPI version Anaconda-Server Badge PyPI - Downloads

DataComPy is a package to compare two DataFrames (or tables) such as Pandas, Spark, Polars, and even Snowflake. Originally it was created to be something of a replacement for SAS's PROC COMPARE for Pandas DataFrames with some more functionality than just Pandas.DataFrame.equals(Pandas.DataFrame) (in that it prints out some stats, and lets you tweak how accurate matches have to be). Supported types include:

  • Pandas
  • Polars
  • Spark
  • Snowflake (via snowpark)
  • Dask (via Fugue)
  • DuckDB (via Fugue)

Quick Installation

pip install datacompy

or

conda install datacompy

Installing extras

If you would like to use Spark or any other backends please make sure you install via extras:

pip install datacompy[spark]
pip install datacompy[fugue]
pip install datacompy[snowflake]

LegacySparkCompare and SparkPandasCompare removal

Starting with v0.17.0, both LegacySparkCompare and SparkPandasCompare have been removed.

Supported versions and dependencies

Different versions of Spark, Pandas, and Python interact differently. Below is a matrix of what we test with. With the move to Pandas on Spark API and compatability issues with Pandas 2+ we will for the mean time note support Pandas 2 with the Pandas on Spark implementation. Spark plans to support Pandas 2 in Spark 4

Spark 3.2.4 Spark 3.3.4 Spark 3.4.2 Spark 3.5.1
Python 3.10
Python 3.11
Python 3.12
Pandas < 1.5.3 Pandas >=2.0.0
Compare
SparkSQLCompare
Fugue

[!NOTE] At the current time Python 3.12 is not supported by Spark and also Ray within Fugue. If you are using Python 3.12 and above, please note that not all functioanlity will be supported. Pandas and Polars support should work fine and are tested.

Supported backends

  • Pandas: (See documentation)
  • Spark: (See documentation)
  • Polars: (See documentation)
  • Snowflake/Snowpark: (See documentation)
  • Fugue is a Python library that provides a unified interface for data processing on Pandas, DuckDB, Polars, Arrow, Spark, Dask, Ray, and many other backends. DataComPy integrates with Fugue to provide a simple way to compare data across these backends. Please note that Fugue will use the Pandas (Native) logic at its lowest level (See documentation)

Contributors

We welcome and appreciate your contributions! Before we can accept any contributions, we ask that you please be sure to sign the Contributor License Agreement (CLA).

This project adheres to the Open Source Code of Conduct. By participating, you are expected to honor this code.

Roadmap

Roadmap details can be found here

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

datacompy-0.17.1.tar.gz (91.6 kB view details)

Uploaded Source

Built Distribution

datacompy-0.17.1-py3-none-any.whl (65.7 kB view details)

Uploaded Python 3

File details

Details for the file datacompy-0.17.1.tar.gz.

File metadata

  • Download URL: datacompy-0.17.1.tar.gz
  • Upload date:
  • Size: 91.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.18

File hashes

Hashes for datacompy-0.17.1.tar.gz
Algorithm Hash digest
SHA256 1f24443f244f4e72a6046ae667b5c26aff7ee5280c92165c9c141a0249d85283
MD5 26111eb1b642fce23518f5de8e53f9c7
BLAKE2b-256 6c67c5613403a16710cf2f9e7553a44f67b5f00e5b57c86fc6b17176f2e6126d

See more details on using hashes here.

File details

Details for the file datacompy-0.17.1-py3-none-any.whl.

File metadata

  • Download URL: datacompy-0.17.1-py3-none-any.whl
  • Upload date:
  • Size: 65.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.18

File hashes

Hashes for datacompy-0.17.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c7cba60b56b4262191c01167783e396122f7116959c6e70c5f934057289dbaa5
MD5 bd12fb91a2008cf445cf4843bcc6d658
BLAKE2b-256 2fc6e325068cf25375e5ff270f094914c43687997ab77b99228f0bf2472235fd

See more details on using hashes here.

Supported by

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