# Drops duplicates in DataFrames with tedious dtypes
## Tested against Windows / Python 3.11 / Anaconda
## pip install dropduplicatesplanb
```
import pandas as pd
from dropduplicatesplanb import pd_add_drop_duplicates_planB
pd_add_drop_duplicates_planB()
df = pd.read_csv(
"https://raw.githubusercontent.com/pandas-dev/pandas/main/doc/data/titanic.csv"
)
df["baba"] = df.Embarked.apply(lambda q: [q, q, q, q])
df.loc[0, "baba"] = [[[1, 2, 34, 4, 2, 2, 34, 2, 1]]]
df.loc[1, "baba"] = [[[1, 2, 34, 4, 2, 2, 34, 2, 1]]]
df = pd.concat([df for x in range(2)], ignore_index=True)
df21 = df.d_drop_duplicates_planB(subset="baba")
df32 = df.d_drop_duplicates_planB(subset=["PassengerId", "Survived"])
df43 = df.d_drop_duplicates_planB(subset=["PassengerId", "Survived"], keep="first")
df54 = df.d_drop_duplicates_planB()
print(df)
print(df21)
print(df32)
print(df43)
print(df54)
```
Raw data
{
"_id": null,
"home_page": "https://github.com/hansalemaos/dropduplicatesplanb",
"name": "dropduplicatesplanb",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "dataframe,duplicates",
"author": "Johannes Fischer",
"author_email": "aulasparticularesdealemaosp@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/14/2e/e98924dd993692a91e48197f8a296ec29a3d3d9aa5ae8526310823199d60/dropduplicatesplanb-0.11.tar.gz",
"platform": null,
"description": "\r\n# Drops duplicates in DataFrames with tedious dtypes\r\n \r\n## Tested against Windows / Python 3.11 / Anaconda\r\n\r\n## pip install dropduplicatesplanb\r\n\r\n```\r\nimport pandas as pd\r\nfrom dropduplicatesplanb import pd_add_drop_duplicates_planB\r\n\r\npd_add_drop_duplicates_planB()\r\ndf = pd.read_csv(\r\n \"https://raw.githubusercontent.com/pandas-dev/pandas/main/doc/data/titanic.csv\"\r\n)\r\n\r\n\r\ndf[\"baba\"] = df.Embarked.apply(lambda q: [q, q, q, q])\r\ndf.loc[0, \"baba\"] = [[[1, 2, 34, 4, 2, 2, 34, 2, 1]]]\r\ndf.loc[1, \"baba\"] = [[[1, 2, 34, 4, 2, 2, 34, 2, 1]]]\r\ndf = pd.concat([df for x in range(2)], ignore_index=True)\r\ndf21 = df.d_drop_duplicates_planB(subset=\"baba\")\r\ndf32 = df.d_drop_duplicates_planB(subset=[\"PassengerId\", \"Survived\"])\r\ndf43 = df.d_drop_duplicates_planB(subset=[\"PassengerId\", \"Survived\"], keep=\"first\")\r\ndf54 = df.d_drop_duplicates_planB()\r\nprint(df)\r\nprint(df21)\r\nprint(df32)\r\nprint(df43)\r\nprint(df54)\r\n\r\n```\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Drops duplicates in DataFrames with tedious dtypes",
"version": "0.11",
"project_urls": {
"Homepage": "https://github.com/hansalemaos/dropduplicatesplanb"
},
"split_keywords": [
"dataframe",
"duplicates"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e9f801d9dc4f182099654dcf7ce8ec5b3f5ba27cda9b644d4b61179d73e095e5",
"md5": "4e4bce627b74be24b016cb86fb085e2e",
"sha256": "2795c5605ddf94f69ae2b1e7392c75a5e60204d03f9d820fb662b4975ad3a6a8"
},
"downloads": -1,
"filename": "dropduplicatesplanb-0.11-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4e4bce627b74be24b016cb86fb085e2e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 21485,
"upload_time": "2024-02-02T06:33:09",
"upload_time_iso_8601": "2024-02-02T06:33:09.533324Z",
"url": "https://files.pythonhosted.org/packages/e9/f8/01d9dc4f182099654dcf7ce8ec5b3f5ba27cda9b644d4b61179d73e095e5/dropduplicatesplanb-0.11-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "142ee98924dd993692a91e48197f8a296ec29a3d3d9aa5ae8526310823199d60",
"md5": "9378851ac4a6e18894598c97bb4c8e3a",
"sha256": "f332909e839455a272c183688e3747ad6c1dc73a1dab88393bf22959ceb75caf"
},
"downloads": -1,
"filename": "dropduplicatesplanb-0.11.tar.gz",
"has_sig": false,
"md5_digest": "9378851ac4a6e18894598c97bb4c8e3a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 20882,
"upload_time": "2024-02-02T06:33:11",
"upload_time_iso_8601": "2024-02-02T06:33:11.275572Z",
"url": "https://files.pythonhosted.org/packages/14/2e/e98924dd993692a91e48197f8a296ec29a3d3d9aa5ae8526310823199d60/dropduplicatesplanb-0.11.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-02 06:33:11",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "hansalemaos",
"github_project": "dropduplicatesplanb",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "dropduplicatesplanb"
}