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.1.tar.gz
(3.2 kB
view details)
Built Distribution
File details
Details for the file compare_dfs-0.0.1.tar.gz
.
File metadata
- Download URL: compare_dfs-0.0.1.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 | f9c2688bffe3f61010bcdc652a9f8bef87e5b80cc33102238df08e3b1c06d027 |
|
MD5 | c881b542948b38976c5a720d6180f207 |
|
BLAKE2b-256 | 403f31e3c4c461cdba19c3563b18af5d5e39e786ffaeb7765123d5f73fda3ca4 |
File details
Details for the file compare_dfs-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: compare_dfs-0.0.1-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 | 4bf18ce7b6eeaba99566f6b84005659c589adcc051f28be61eefe590eaae8e37 |
|
MD5 | b35110a7d5ce78201a64b5684ae459bd |
|
BLAKE2b-256 | 4e8a1fd20af3986785eff46a4a40842fc3c225d20ddf80fefbad7c476e199241 |