Skip to content
Snippets Groups Projects
Commit 08dba668 authored by Peter Lünenschloß's avatar Peter Lünenschloß
Browse files

black/changelock

parent 4eb2ca53
No related branches found
No related tags found
1 merge request!824target broadcasting and numpy array support for generics
Pipeline #204287 passed with stages
in 5 minutes and 52 seconds
......@@ -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
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment