Pandas-indexing

Latest version: v0.6.0

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

Scan your dependencies

Page 1 of 4

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)

0.5.0

------------------------------------------------------------
* **BREAKING**: Change :func:`~core.extractlevel` to drop split levels by default and
accordingly rename the governing argument from ``drop=False`` to ``keep=False``
:pull:`53`.
* Add ``regex=True`` argument to :func:`~core.extractlevel` to use templates as
manual extraction regex, f.ex.
``df.pix.extract(variable=r"Emissions\|(?P<gas>.*?)(?:\|(?P<sector>.*?))?",
regex=True)`` will also split ``Emissions|CO2`` to ``gas = "CO2"`` and
``sector = NaN``, while ``df.pix.extract(variable="Emissions|{gas}|{sector}")`` would
have dropped it.
* Update :func:`~core.projectlevel` to raise ``KeyError`` for wrong level names
:pull:`52`.

0.4.2

------------------------------------------------------------
* Add :func:`~core.add_zeros_like` for adding explicit ``levels`` as 0 values :pull:`51`

0.4.1

------------------------------------------------------------
* Add :func:`~core.antijoin` for performing anti-joins :pull:`48`
* Update usage guide for ``antijoin``, but also with more focus on ``extractlevel``

Page 1 of 4

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.