From 33952a38588b2d35a40de19ef8b438fc1dfc64a7 Mon Sep 17 00:00:00 2001 From: David Schaefer <david.schaefer@ufz.de> Date: Wed, 11 Dec 2019 00:11:26 +0100 Subject: [PATCH] fixed Series vs DataFrame bug --- saqc/lib/plotting.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/saqc/lib/plotting.py b/saqc/lib/plotting.py index 3ea8dea32..900efcad2 100644 --- a/saqc/lib/plotting.py +++ b/saqc/lib/plotting.py @@ -1,11 +1,9 @@ #! /usr/bin/env python # -*- coding: utf-8 -*- -# TODO: use the logging module import logging import pandas as pd import numpy as np -from warnings import warn __plotvars = [] @@ -24,7 +22,9 @@ def plotHook(data, old, new, varname, do_plot, flag_test, plot_nans=True): __plotvars.append(varname) # cannot use getFlags here, because if a flag was set (e.g. with force) the # flag may be the same, but any additional row (e.g. comment-field) would differ - mask = (old._flags[varname] != new._flags[varname]).any(axis=1) + mask = (old._flags[varname] != new._flags[varname]) + if isinstance(mask, pd.DataFrame): + mask = mask.any(axis=1) _plot(data, new, mask, varname, title=flag_test, plot_nans=plot_nans) -- GitLab