Name | pandas-sans-lambdas JSON |
Version |
0.1.1
JSON |
| download |
home_page | |
Summary | Tools to simplify pandas-based data processing |
upload_time | 2023-07-18 12:41:54 |
maintainer | |
docs_url | None |
author | |
requires_python | >=3.6 |
license | MIT License Copyright (c) 2022 Jake Antmann Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
pandas
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Pandas Sans Lambdas
![Tests](https://github.com/jakeantmann/pandas_sans_lambdas/actions/workflows/tests.yml/badge.svg)
Pandas method chaining using `assign` or `loc` usually means using lambdas. These get repetitive and reduce readability. Pandas Sans Lambdas is a solution to this. Here's an example:
``` python
import pandas as pd
from pandas_sans_lambdas import col
df = pd.DataFrame({"a": [1,2,3], "b": [4,5,6]})
# The old way
df = df.assign(with_lambdas = lambda DF: DF["a"] ** 2 / DF["b"])
# The new way
df = df.assign(sans_lambdas = col("a") ** 2 / col("b"))
print(df)
```
Hopefully you agree that this is more readable!
## Current project status
This package is under development. Specifically, unit test coverage is currently incomplete. Get in touch if you want to contribute to test coverage, or if you find any bugs!
Raw data
{
"_id": null,
"home_page": "",
"name": "pandas-sans-lambdas",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "Jake Antmann <jakeantmann@gmail.com>",
"keywords": "pandas",
"author": "",
"author_email": "Jake Antmann <jakeantmann@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/29/13/2b624b8c99949a1dee251db10bf255cfbc82a73c3e6ab3d11f5bb15e54cc/pandas_sans_lambdas-0.1.1.tar.gz",
"platform": null,
"description": "# Pandas Sans Lambdas\n\n![Tests](https://github.com/jakeantmann/pandas_sans_lambdas/actions/workflows/tests.yml/badge.svg)\n\nPandas method chaining using `assign` or `loc` usually means using lambdas. These get repetitive and reduce readability. Pandas Sans Lambdas is a solution to this. Here's an example:\n\n``` python\nimport pandas as pd\nfrom pandas_sans_lambdas import col\n\ndf = pd.DataFrame({\"a\": [1,2,3], \"b\": [4,5,6]})\n\n# The old way\ndf = df.assign(with_lambdas = lambda DF: DF[\"a\"] ** 2 / DF[\"b\"])\n\n# The new way\ndf = df.assign(sans_lambdas = col(\"a\") ** 2 / col(\"b\"))\n\nprint(df)\n```\n\nHopefully you agree that this is more readable!\n\n## Current project status\n\nThis package is under development. Specifically, unit test coverage is currently incomplete. Get in touch if you want to contribute to test coverage, or if you find any bugs!\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2022 Jake Antmann Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
"summary": "Tools to simplify pandas-based data processing",
"version": "0.1.1",
"project_urls": {
"discussions": "https://github.com/jakeantmann/pandas_sans_lambdas/discussions",
"homepage": "https://github.com/jakeantmann/pandas_sans_lambdas",
"issues": "https://github.com/jakeantmann/pandas_sans_lambdas/issues",
"releases": "https://github.com//jakeantmann/pandas_sans_lambdas/releases",
"repository": "https://github.com//jakeantmann/pandas_sans_lambdas"
},
"split_keywords": [
"pandas"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a6b0087ba69bb77bfef21bcbe191c94d624cfcb4e7f56643081512068fae4653",
"md5": "66c0a2b621d06e97e63edbb09dc67750",
"sha256": "a3ab705d12b53804ae23f09e3e91ad4b9b48bc2884e4b75d2ecdb8a5107a51ee"
},
"downloads": -1,
"filename": "pandas_sans_lambdas-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "66c0a2b621d06e97e63edbb09dc67750",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 15399,
"upload_time": "2023-07-18T12:41:52",
"upload_time_iso_8601": "2023-07-18T12:41:52.403255Z",
"url": "https://files.pythonhosted.org/packages/a6/b0/087ba69bb77bfef21bcbe191c94d624cfcb4e7f56643081512068fae4653/pandas_sans_lambdas-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "29132b624b8c99949a1dee251db10bf255cfbc82a73c3e6ab3d11f5bb15e54cc",
"md5": "9cb168129657ef736001ecfa3ae62985",
"sha256": "99fe8b0a374005e0fdc210b8cedfe8fb5250143dea74272f55dd0e4a5ea55fac"
},
"downloads": -1,
"filename": "pandas_sans_lambdas-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "9cb168129657ef736001ecfa3ae62985",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 18365,
"upload_time": "2023-07-18T12:41:54",
"upload_time_iso_8601": "2023-07-18T12:41:54.553557Z",
"url": "https://files.pythonhosted.org/packages/29/13/2b624b8c99949a1dee251db10bf255cfbc82a73c3e6ab3d11f5bb15e54cc/pandas_sans_lambdas-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-07-18 12:41:54",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "jakeantmann",
"github_project": "pandas_sans_lambdas",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "pandas-sans-lambdas"
}