Skip to main content
CI Codecov Read the Docs PyPI Conda

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:

df.loc[isin(model="m1", scenario=["s1", "s2"])]

or with shell like glob-patterns:

df.loc[
    ismatch(
        model="REMIND*", variable="Emissions|**", unit=["Mt CO2/yr", "kt N2O/yr"]
    )
]

You can overwrite index levels:

assignlevel(df, selected=1)

or project your data to only a few desired index levels:

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.

Metadata

Release files for pandas-indexing 0.6.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pandas-indexing 0.6.3
File Size Uploaded
pandas_indexing-0.6.3.tar.gz 48.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pandas-indexing 0.6.3
File Interpreter ABI Platform
pandas_indexing-0.6.3-py3-none-any.whl Python 3 none any Details

Total release size: 81.8 kB

Release files / pandas_indexing-0.6.3.tar.gz

Download URL pandas_indexing-0.6.3.tar.gz
Size 48.7 kB
Tags Source
SHA-256 checksum
How to use checksums
3cfcb19c67ef286f58a77e528fb5afad095173fd238b3d4f3363e26ee1bddcb7
BLAKE2b-256 checksum
How to use checksums
e9a4ae47c134967d119051c357c054e98be14994cfb034bef21c65e5362dd146
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / pandas_indexing-0.6.3-py3-none-any.whl

Download URL pandas_indexing-0.6.3-py3-none-any.whl
Size 33.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a51d92359b6d65c4d90d35ce727f8f1ab045aa8c1bc204478ce17089c23ced0f
BLAKE2b-256 checksum
How to use checksums
678a517d31c6b7326bf814024b83ecc6396e65e71b68b37f2c4638795d637a15
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release history Release notifications | RSS feed

This release

0.6.3 This release

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3

2 release files

0.2.10

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page