# dfcompy
## Description
`dfcompy` is a Python package that provides a comprehensive tool for comparing two Pandas DataFrame objects. It can identify rows that are inserted, deleted, or updated between two DataFrames, catering especially to data analysis and data cleaning processes.
## Installation
Install `dfcompy` using pip:
```bash
pip install dfcompy
```
## Usage
```python
import pandas as pd
from dfcompy import DataFrameComparator
# Create example DataFrames
# ... [example DataFrame creation]
# Create a DataFrameComparator instance
comparator = DataFrameComparator(df1, df2, on=['ID'], subset=['Name', 'Age'])
# Detect deleted rows
print("Deleted Rows:")
print(comparator.rows_deleted())
# Detect inserted rows
print("\nInserted Rows:")
print(comparator.rows_inserted())
# Detect updated rows
print("\nUpdated Rows:")
print(comparator.rows_before_update())
# Detect unchanged rows
print("\nUnchanged Rows:")
print(comparator.rows_in_common())
```
## Contributing
Contributions are welcome! For major changes, please open an issue first to discuss what you would like to change.
## License
[MIT](https://choosealicense.com/licenses/mit/)
Raw data
{
"_id": null,
"home_page": "",
"name": "dfcompy",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "python,pandas,dataframe,compare,diff,data analysis",
"author": "GuangJun Liang",
"author_email": "gaungjun_l@icloud.com",
"download_url": "https://files.pythonhosted.org/packages/37/48/d5c881f7b49bfa7c496c3546206a8bf3a8c962bc3e385d256ae6c747bb5c/dfcompy-1.0.0.tar.gz",
"platform": null,
"description": "\r\n\r\r\n# dfcompy\r\r\n\r\r\n## Description\r\r\n\r\r\n`dfcompy` is a Python package that provides a comprehensive tool for comparing two Pandas DataFrame objects. It can identify rows that are inserted, deleted, or updated between two DataFrames, catering especially to data analysis and data cleaning processes.\r\r\n\r\r\n## Installation\r\r\n\r\r\nInstall `dfcompy` using pip:\r\r\n\r\r\n```bash\r\r\npip install dfcompy\r\r\n```\r\r\n\r\r\n## Usage\r\r\n\r\r\n```python\r\r\nimport pandas as pd\r\r\nfrom dfcompy import DataFrameComparator\r\r\n\r\r\n# Create example DataFrames\r\r\n# ... [example DataFrame creation]\r\r\n\r\r\n# Create a DataFrameComparator instance\r\r\ncomparator = DataFrameComparator(df1, df2, on=['ID'], subset=['Name', 'Age'])\r\r\n\r\r\n# Detect deleted rows\r\r\nprint(\"Deleted Rows:\")\r\r\nprint(comparator.rows_deleted())\r\r\n\r\r\n# Detect inserted rows\r\r\nprint(\"\\nInserted Rows:\")\r\r\nprint(comparator.rows_inserted())\r\r\n\r\r\n# Detect updated rows\r\r\nprint(\"\\nUpdated Rows:\")\r\r\nprint(comparator.rows_before_update())\r\r\n\r\r\n# Detect unchanged rows\r\r\nprint(\"\\nUnchanged Rows:\")\r\r\nprint(comparator.rows_in_common())\r\r\n```\r\r\n\r\r\n## Contributing\r\r\n\r\r\nContributions are welcome! For major changes, please open an issue first to discuss what you would like to change.\r\r\n\r\r\n## License\r\r\n\r\r\n[MIT](https://choosealicense.com/licenses/mit/)\r\r\n",
"bugtrack_url": null,
"license": "",
"summary": "A tool for comparing two Pandas DataFrame objects",
"version": "1.0.0",
"project_urls": null,
"split_keywords": [
"python",
"pandas",
"dataframe",
"compare",
"diff",
"data analysis"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "3748d5c881f7b49bfa7c496c3546206a8bf3a8c962bc3e385d256ae6c747bb5c",
"md5": "a84b1337adf284effb4694178789a1a7",
"sha256": "27e96ba49ffe4c209af1c64cd95388dc4ec01f025b499d18542602cb5f3efe6a"
},
"downloads": -1,
"filename": "dfcompy-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "a84b1337adf284effb4694178789a1a7",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 5261,
"upload_time": "2023-12-14T17:52:09",
"upload_time_iso_8601": "2023-12-14T17:52:09.584567Z",
"url": "https://files.pythonhosted.org/packages/37/48/d5c881f7b49bfa7c496c3546206a8bf3a8c962bc3e385d256ae6c747bb5c/dfcompy-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-12-14 17:52:09",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "dfcompy"
}