diff --git a/CHANGELOG.md b/CHANGELOG.md index ec5745c7a1293df9234d97cdd047a9a7ddc49a95..3409d90b0f40720f9ba0238b310cc8aaa454347d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,6 @@ SPDX-License-Identifier: GPL-3.0-or-later [List of commits](https://git.ufz.de/rdm-software/saqc/-/compare/v2.5.0...develop) ### Added - `generics`: target broadcasting and numpy array support -- `flagGeneric`: target broadcasting - `SaQC`: automatic translation of incoming flags - Option to change the flagging scheme after initialization - `flagByClick`: manually assign flags using a graphical user interface diff --git a/saqc/funcs/generic.py b/saqc/funcs/generic.py index 165190ce8713f03da06842ef9ad9e3b1a67b22cd..56c00bb2505ad27aa95adb4ed3688beb821eafcc 100644 --- a/saqc/funcs/generic.py +++ b/saqc/funcs/generic.py @@ -83,15 +83,17 @@ def _inferBroadcast(obj, trg_shape) -> pd.DataFrame: return np.full(trg_shape, obj) return obj + def _inferDF(obj, cols, index): # infer dataframe if result is numpy array of fitting shape if isinstance(obj, np.ndarray): lc = len(cols) li = len(index) - if (obj.shape == (li,lc)) or (obj.shape == (li,)): + if (obj.shape == (li, lc)) or (obj.shape == (li,)): return pd.DataFrame(obj, columns=cols, index=index) return obj + def _castResult(obj) -> DictOfSeries: # Note: the actual keys aka. column names # we use here to create a DictOfSeries