Name | pandas-indexing JSON |
Version |
0.6.1
JSON |
| download |
home_page | None |
Summary | Helpers to facilitate working with pandas indices in particular multiindices |
upload_time | 2024-12-01 14:58:46 |
maintainer | None |
docs_url | None |
author | None |
requires_python | <4,>=3.9 |
license | MIT |
keywords |
pandas
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
|
pandas-indexing helper
======================
.. image:: https://github.com/coroa/pandas-indexing/workflows/ci/badge.svg?branch=main
:target: https://github.com/coroa/pandas-indexing/actions?workflow=ci
:alt: CI
.. image:: https://codecov.io/gh/coroa/pandas-indexing/branch/main/graph/badge.svg
:target: https://codecov.io/gh/coroa/pandas-indexing
:alt: Codecov
.. image:: https://img.shields.io/readthedocs/pandas-indexing/latest?label=Read%20the%20Docs
:target: https://pandas-indexing.readthedocs.io/en/latest/
:alt: Read the Docs
.. image:: https://img.shields.io/pypi/v/pandas-indexing
:target: https://pypi.org/project/pandas-indexing/
:alt: PyPI
Summary
-------
``pandas-indexing`` is a helpers package to make interacting with pandas multi-indices less
painful. It contains functions, that
* filter easily into multi indices: ``isin``, ``ismatch``
* add or update levels in a multiindex: ``assignlevel``
* select one or multiple specific levels: ``projectlevel``
Usage
-----
Given you have a time-series like dataframe with several multi index levels, like ``model``, ``scenario``, ``variable``:
then you can select a subset with:
.. code:: python
df.loc[isin(model="m1", scenario=["s1", "s2"])]
or with shell like glob-patterns:
.. code:: python
df.loc[
ismatch(
model="REMIND*", variable="Emissions|**", unit=["Mt CO2/yr", "kt N2O/yr"]
)
]
You can overwrite index levels:
.. code:: python
assignlevel(df, selected=1)
or project your data to only a few desired index levels:
.. code:: python
projectlevel(df, ["model", "scenario"])
All commands are described in detail in the API reference in `documentation`_ and are
togehter with introductions for installing and using this package, but they are mostly
bare-bones atm.
Issues and Discussions
----------------------
As usual for any GitHub-based project, raise an `issue`_ if you find any bug or
want to suggest an improvement, or open a discussion if you want to discuss.
.. _PyPI: https://pypi.org
.. _latest branch: https://github.com/coroa/pandas-indexing/tree/latest
.. _master branch: https://github.com/coroa/pandas-indexing/tree/master
.. _tox: https://tox.readthedocs.io/en/latest/
.. _ReadTheDocs: https://readthedocs.org/
.. _issue: htts://github.com/coroa/pandas-indexing/issues/new
.. _documentation: https://pandas-indexing.readthedocs.io/en/latest/
Raw data
{
"_id": null,
"home_page": null,
"name": "pandas-indexing",
"maintainer": null,
"docs_url": null,
"requires_python": "<4,>=3.9",
"maintainer_email": null,
"keywords": "pandas",
"author": null,
"author_email": "Jonas H\u00f6rsch <coroa@posteo.de>",
"download_url": "https://files.pythonhosted.org/packages/fe/24/e4dde61f2f0dbc83f5b6b6b0fbc33ae7b88e3f056854ecde6891c2c9e2be/pandas_indexing-0.6.1.tar.gz",
"platform": null,
"description": "pandas-indexing helper\n======================\n\n.. image:: https://github.com/coroa/pandas-indexing/workflows/ci/badge.svg?branch=main\n :target: https://github.com/coroa/pandas-indexing/actions?workflow=ci\n :alt: CI\n\n.. image:: https://codecov.io/gh/coroa/pandas-indexing/branch/main/graph/badge.svg\n :target: https://codecov.io/gh/coroa/pandas-indexing\n :alt: Codecov\n\n.. image:: https://img.shields.io/readthedocs/pandas-indexing/latest?label=Read%20the%20Docs\n :target: https://pandas-indexing.readthedocs.io/en/latest/\n :alt: Read the Docs\n\n.. image:: https://img.shields.io/pypi/v/pandas-indexing\n :target: https://pypi.org/project/pandas-indexing/\n :alt: PyPI\n\n\nSummary\n-------\n\n``pandas-indexing`` is a helpers package to make interacting with pandas multi-indices less\npainful. It contains functions, that\n\n* filter easily into multi indices: ``isin``, ``ismatch``\n* add or update levels in a multiindex: ``assignlevel``\n* select one or multiple specific levels: ``projectlevel``\n\nUsage\n-----\n\nGiven you have a time-series like dataframe with several multi index levels, like ``model``, ``scenario``, ``variable``:\nthen you can select a subset with:\n\n.. code:: python\n\n df.loc[isin(model=\"m1\", scenario=[\"s1\", \"s2\"])]\n\nor with shell like glob-patterns:\n\n.. code:: python\n\n df.loc[\n ismatch(\n model=\"REMIND*\", variable=\"Emissions|**\", unit=[\"Mt CO2/yr\", \"kt N2O/yr\"]\n )\n ]\n\nYou can overwrite index levels:\n\n.. code:: python\n\n assignlevel(df, selected=1)\n\nor project your data to only a few desired index levels:\n\n.. code:: python\n\n projectlevel(df, [\"model\", \"scenario\"])\n\n\nAll commands are described in detail in the API reference in `documentation`_ and are\ntogehter with introductions for installing and using this package, but they are mostly\nbare-bones atm.\n\nIssues and Discussions\n----------------------\n\nAs usual for any GitHub-based project, raise an `issue`_ if you find any bug or\nwant to suggest an improvement, or open a discussion if you want to discuss.\n\n\n.. _PyPI: https://pypi.org\n.. _latest branch: https://github.com/coroa/pandas-indexing/tree/latest\n.. _master branch: https://github.com/coroa/pandas-indexing/tree/master\n.. _tox: https://tox.readthedocs.io/en/latest/\n.. _ReadTheDocs: https://readthedocs.org/\n.. _issue: htts://github.com/coroa/pandas-indexing/issues/new\n.. _documentation: https://pandas-indexing.readthedocs.io/en/latest/\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Helpers to facilitate working with pandas indices in particular multiindices",
"version": "0.6.1",
"project_urls": {
"changelog": "https://github.com/coroa/pandas-indexing/blob/main/CHANGELOG.rst",
"documentation": "https://pandas-indexing.readthedocs.io/en/latest/",
"homepage": "https://github.com/coroa/pandas-indexing",
"repository": "https://github.com/coroa/pandas-indexing.git"
},
"split_keywords": [
"pandas"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e16eaebcae22b888ee028efa65edaa79e89b0c9359ae2d75bcf6184a24234365",
"md5": "136aa60d350a67fd9353feeb44565c9e",
"sha256": "8256b6237ccbb42690d9de7c2298d812cf9687e5609d0bcaff862c90e84a1abd"
},
"downloads": -1,
"filename": "pandas_indexing-0.6.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "136aa60d350a67fd9353feeb44565c9e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4,>=3.9",
"size": 32250,
"upload_time": "2024-12-01T14:58:36",
"upload_time_iso_8601": "2024-12-01T14:58:36.428120Z",
"url": "https://files.pythonhosted.org/packages/e1/6e/aebcae22b888ee028efa65edaa79e89b0c9359ae2d75bcf6184a24234365/pandas_indexing-0.6.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "fe24e4dde61f2f0dbc83f5b6b6b0fbc33ae7b88e3f056854ecde6891c2c9e2be",
"md5": "82b56c4a0735db30fb9100e13486faaa",
"sha256": "4f1fb7563f730d328fcc46e2c2f573ecc0ef3ede1a552b6c5bf04951bfda3176"
},
"downloads": -1,
"filename": "pandas_indexing-0.6.1.tar.gz",
"has_sig": false,
"md5_digest": "82b56c4a0735db30fb9100e13486faaa",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4,>=3.9",
"size": 75847,
"upload_time": "2024-12-01T14:58:46",
"upload_time_iso_8601": "2024-12-01T14:58:46.765797Z",
"url": "https://files.pythonhosted.org/packages/fe/24/e4dde61f2f0dbc83f5b6b6b0fbc33ae7b88e3f056854ecde6891c2c9e2be/pandas_indexing-0.6.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-01 14:58:46",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "coroa",
"github_project": "pandas-indexing",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"tox": true,
"lcname": "pandas-indexing"
}