A small example package
Project description
compare_df
介绍
找出两个几乎相同的DataFrame的差异
安装
pip install compare_df
使用
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.2.tar.gz
(3.2 kB
view details)
Built Distribution
File details
Details for the file compare_dfs-0.0.2.tar.gz
.
File metadata
- Download URL: compare_dfs-0.0.2.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | c74be679326a192a5676c23a59c366c13c7ba730f6bafdca748c45d6cec393a1 |
|
MD5 | 420eeecc1e7c1abe71318ec08331835b |
|
BLAKE2b-256 | 3d14c613e86b6649a2207855568b8b8908601b4c2f85c0c387ab3c6b932ccb2b |
File details
Details for the file compare_dfs-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: compare_dfs-0.0.2-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 401ae555075c90160d06f49c9c3fd8b380035dae2455b6ca20189dec90ee2fc6 |
|
MD5 | 08ef00b00ba6ae569d3f45aabde93737 |
|
BLAKE2b-256 | d915848d742e65c2fa3f0dde97f7bdea98bd86943abb7666c49af445619c44f6 |