Skip to main content

A small example package

Project description

compare_df

介绍

找出两个几乎相同的DataFrame的差异

安装

pip install compare_dfs

使用

import pandas as pd
import compare_dfs.compare as compare

df1 = pd.DataFrame({
    "id": [1, 2, 3, 4, 5],
    "name": ["a", "b", "c", "d", "e"],
    "age1": [10, 20, 30, 40, 50],
})
                   
df2 = pd.DataFrame({
    "id": [1, 2, 3, 4, 6],
    "name": ["a", "b", "f", "d", "e"],
    "age2": [10, 25, 30, 40, 50],
})

# 检查所有列名一致的列,其余请填入different_col_names
compare(df1, df2, col_index="id", different_col_names=[("age1", "age2")], dfname_1="左表", dfname_2="右表")

输出:

左表中有,右表中没有的id:{5}
右表中有,左表中没有的id:{6}
=====================================
   name_左表 name_右表
id                
3        c       f
=====================================
    age1  age2
id            
2     20    25
=====================================

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

compare_dfs-0.0.3.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

compare_dfs-0.0.3-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file compare_dfs-0.0.3.tar.gz.

File metadata

  • Download URL: compare_dfs-0.0.3.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.12

File hashes

Hashes for compare_dfs-0.0.3.tar.gz
Algorithm Hash digest
SHA256 867680b5647b26bca789225ee65a224d51a39c72fead7fac947a662c0c924fd5
MD5 a1f738129eac52d43de22e4cc9649101
BLAKE2b-256 a4d5b508738bbc7b94caa188af6c611dd840dfad1abd6a4537602fcf4d1b12f2

See more details on using hashes here.

File details

Details for the file compare_dfs-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: compare_dfs-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.12

File hashes

Hashes for compare_dfs-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 2a09642b94d48e33af7501fc4dfadb86a5860878aa4c0b937c59d320874efd34
MD5 e80b7a8843ea0001572d4e4ce8c19427
BLAKE2b-256 5ab29a381b99edeba3cac98e6b49e57ce571f71f8bd7b069cb1ca04e676b9d02

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