# Aggregates multiple columns of a DataFrame
```python
pip install a-pandas-ex-mindex-aggregate
```
```python
from a_pandas_ex_mindex_aggregate import pd_add_mindex_aggregate
import pandas as pd
pd_add_mindex_aggregate()
df = pd.read_csv("https://github.com/pandas-dev/pandas/raw/main/doc/data/titanic.csv")
PassengerId Survived Pclass ... Fare Cabin Embarked
0 1 0 3 ... 7.2500 NaN S
1 2 1 1 ... 71.2833 C85 C
2 3 1 3 ... 7.9250 NaN S
3 4 1 1 ... 53.1000 C123 S
4 5 0 3 ... 8.0500 NaN S
.. ... ... ... ... ... ... ...
886 887 0 2 ... 13.0000 NaN S
887 888 1 1 ... 30.0000 B42 S
888 889 0 3 ... 23.4500 NaN S
889 890 1 1 ... 30.0000 C148 C
890 891 0 3 ... 7.7500 NaN Q
[891 rows x 12 columns]
df.d_multiindex_aggregate(['Fare', 'Age'])
PassengerId Survived ... Cabin Embarked
Fare Age ...
0.0000 19.0 [303] [0] ... [nan] [S]
25.0 [272] [1] ... [nan] [S]
36.0 [180] [0] ... [nan] [S]
38.0 [823] [0] ... [nan] [S]
39.0 [807] [0] ... [A36] [S]
... ... ... ... ...
263.0000 23.0 [89] [1] ... [C23 C25 C27] [S]
24.0 [342] [1] ... [C23 C25 C27] [S]
64.0 [439] [0] ... [C23 C25 C27] [S]
512.3292 35.0 [259, 738] [1, 1] ... [nan, B101] [C, C]
36.0 [680] [1] ... [B51 B53 B55] [C]
[815 rows x 10 columns]
```
Raw data
{
"_id": null,
"home_page": "https://github.com/hansalemaos/a_pandas_ex_mindex_aggregate",
"name": "a-pandas-ex-mindex-aggregate",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "pandas,Aggregate,DataFrame",
"author": "Johannes Fischer",
"author_email": "<aulasparticularesdealemaosp@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/a1/70/7da0e84bc1f1dff77963ef5ab671904b55ac36c67a71e333330ade0020f5/a_pandas_ex_mindex_aggregate-0.10.tar.gz",
"platform": null,
"description": "\n# Aggregates multiple columns of a DataFrame\n\n\n\n```python\n\npip install a-pandas-ex-mindex-aggregate\n\n```\n\n\n\n```python\n\n\n\nfrom a_pandas_ex_mindex_aggregate import pd_add_mindex_aggregate\n\nimport pandas as pd\n\npd_add_mindex_aggregate()\n\ndf = pd.read_csv(\"https://github.com/pandas-dev/pandas/raw/main/doc/data/titanic.csv\")\n\n\n\n PassengerId Survived Pclass ... Fare Cabin Embarked\n\n0 1 0 3 ... 7.2500 NaN S\n\n1 2 1 1 ... 71.2833 C85 C\n\n2 3 1 3 ... 7.9250 NaN S\n\n3 4 1 1 ... 53.1000 C123 S\n\n4 5 0 3 ... 8.0500 NaN S\n\n.. ... ... ... ... ... ... ...\n\n886 887 0 2 ... 13.0000 NaN S\n\n887 888 1 1 ... 30.0000 B42 S\n\n888 889 0 3 ... 23.4500 NaN S\n\n889 890 1 1 ... 30.0000 C148 C\n\n890 891 0 3 ... 7.7500 NaN Q\n\n[891 rows x 12 columns]\n\n\n\n\n\ndf.d_multiindex_aggregate(['Fare', 'Age'])\n\n\n\n PassengerId Survived ... Cabin Embarked\n\nFare Age ... \n\n0.0000 19.0 [303] [0] ... [nan] [S]\n\n 25.0 [272] [1] ... [nan] [S]\n\n 36.0 [180] [0] ... [nan] [S]\n\n 38.0 [823] [0] ... [nan] [S]\n\n 39.0 [807] [0] ... [A36] [S]\n\n ... ... ... ... ...\n\n263.0000 23.0 [89] [1] ... [C23 C25 C27] [S]\n\n 24.0 [342] [1] ... [C23 C25 C27] [S]\n\n 64.0 [439] [0] ... [C23 C25 C27] [S]\n\n512.3292 35.0 [259, 738] [1, 1] ... [nan, B101] [C, C]\n\n 36.0 [680] [1] ... [B51 B53 B55] [C]\n\n[815 rows x 10 columns]\n\n\n\n```\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Aggregates multiple columns of a DataFrame",
"version": "0.10",
"split_keywords": [
"pandas",
"aggregate",
"dataframe"
],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "2aa45e84c1dfc1406a276be1c3fe40ed",
"sha256": "42c3bd70ac9a34287eed615e3c24cb2855b69dd72a663ced3bd3b247054c3bd7"
},
"downloads": -1,
"filename": "a_pandas_ex_mindex_aggregate-0.10-py3-none-any.whl",
"has_sig": false,
"md5_digest": "2aa45e84c1dfc1406a276be1c3fe40ed",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 5868,
"upload_time": "2022-12-21T12:31:15",
"upload_time_iso_8601": "2022-12-21T12:31:15.849317Z",
"url": "https://files.pythonhosted.org/packages/73/1d/39061a90bdcbf47d16e8e8f1780670f549ec01f9d98e60e0743ae3531a0f/a_pandas_ex_mindex_aggregate-0.10-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "52cecdc4d8e154c8b14b05ac2e47d51e",
"sha256": "0a75d6c27364caed51a2157eed53a9873c034f1a545cc68ac608131301164fe3"
},
"downloads": -1,
"filename": "a_pandas_ex_mindex_aggregate-0.10.tar.gz",
"has_sig": false,
"md5_digest": "52cecdc4d8e154c8b14b05ac2e47d51e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 4081,
"upload_time": "2022-12-21T12:31:17",
"upload_time_iso_8601": "2022-12-21T12:31:17.524262Z",
"url": "https://files.pythonhosted.org/packages/a1/70/7da0e84bc1f1dff77963ef5ab671904b55ac36c67a71e333330ade0020f5/a_pandas_ex_mindex_aggregate-0.10.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2022-12-21 12:31:17",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "hansalemaos",
"github_project": "a_pandas_ex_mindex_aggregate",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "numpy",
"specs": []
},
{
"name": "pandas",
"specs": []
}
],
"lcname": "a-pandas-ex-mindex-aggregate"
}