Browse Source

fixed a potential pandas.UserWarning in `select_hdr_data()`

main v0.1.1
Holger Frey 2 years ago
parent
commit
adb70d384e
  1. 2
      src/sensospot_tools/__init__.py
  2. 3
      src/sensospot_tools/hdr.py

2
src/sensospot_tools/__init__.py

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
Some small tools for working with parsed Sensospot data.
"""
__version__ = "0.1.0"
__version__ = "0.1.1"
from .hdr import normalize, select_hdr_data # noqa: F401
from .selection import split, select # noqa: F401

3
src/sensospot_tools/hdr.py

@ -47,7 +47,6 @@ def select_hdr_data( @@ -47,7 +47,6 @@ def select_hdr_data(
Raises:
KeyError: if any column does not exist in the data fram
"""
check_columns_exist(data, spot_id_columns, time_column, overflow_column)
spot_ids = ensure_list(spot_id_columns)
@ -62,7 +61,7 @@ def select_hdr_data( @@ -62,7 +61,7 @@ def select_hdr_data(
for next_higher_time in indexed_data_by_time:
selection = hdr_data[overflow_column]
not_in_overlow = hdr_data.loc[~selection].copy()
replacement_for_overlow = next_higher_time[selection].copy()
replacement_for_overlow = next_higher_time.loc[selection].copy()
hdr_data = pandas.concat((not_in_overlow, replacement_for_overlow))
return hdr_data.reset_index()

Loading…
Cancel
Save