Pandas-indexing

Latest version: v0.6.3

Safety actively analyzes 714860 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 5

0.6.3

------------------------------------------------------------
* Extend :func:`~core.concat` with ``DataFrame`` to also reorder the
non-concatenation axis if it is a multiindex in :pull:`71`. Refer to
issue:`69` for an example (thanks to mikapfl for the idea).
* Add multiindex filtering to :func:`~selectors.isin` in :pull:`68`.
``df.loc[isin(index)]`` is similar to ``df.pix.semijoin(index, how="inner")``,
but does not alter the index of `df` and can be combined with other selectors,
like ``df.loc[isin(index) & isin(gas="CO2")]``. Refer also to guide section
:ref:`Selecting based on a multi-index`.

0.6.2

------------------------------------------------------------
* Make :func:`~core.semijoin` and :func:`~core.antijoin` accept a Series or
DataFrame argument to join against :pull:`65`
* Add py.typed file to signal available type hints to downstream packages :pull:`63`

Special thanks to znichollscr for his first contribution.

0.6.1

------------------------------------------------------------
* Fix :meth:`~iamc.resolver.Resolver.iamc_aggregate` to return NaN instead of 0
if no sub-sectors exist.

0.6.0

------------------------------------------------------------
* Add :mod:`~iamc.resolver` module with the class :class:`~iamc.Resolver` that
supports consolidating IAMC-style scenario data with non-homogeneous variable
coverage. Documentation is unfortunately still missing.
* Add support for so-called optional patterns to :func:`~core.extractlevel` and
:func:`~core.formatlevel`, for instance:
``df.pix.extract(variable="Emissions|{gas}|{sector}", optional=["sector"])``
decomposes ``Emissions|CO2`` into ``{"gas": "CO2", "sector": "Total"}``.

0.5.2

------------------------------------------------------------
* Bumps minimum python version to 3.9 (which is close to EOL, anyway)
* Improve :mod:`~selectors` to arbitrarily interact with boolean Series, numpy arrays
and callables, ie.

1. ``pd.Series([True, False]) & isin(model="a")`` produces the same result as
``isin(model="a") & pd.Series([True, False])`` did earlier.
2. ``isin(model="a") & (lambda s: s > 2)`` is now supported as well.

* Fix a testing incompability introduced by a recent attrs update (24.1.0)
* Load pint and pint-pandas packages only on first use

0.5.1

------------------------------------------------------------
* Fix :func:`~selectors.ismatch` to not interpret brackets as regex symbols
* Fix :func:`~selectors.isin` to always return a series (instead of a numpy array)

Page 1 of 5

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.