Closed thouska closed 3 years ago
Problem was: handling of empty timeseries (in case of transformed timeseries, source dataset outside the query time).
Plotting of groundwater head level works fine now. Thx. However, transformed datasets of discharge still produce an error when plotted (e.g. ds370 and ds371 and site13 and 18):
cannot concatenate object of type '<class 'numpy.ndarray'>'; only Series and DataFrame objs are valid
Traceback (most recent call last): File "/srv/odmf/schwingbach/src/odmf/webpage/db_editor/datasetpage.py", line 436, in plot data = ds.asseries(start, end) File "/srv/odmf/schwingbach/src/odmf/db/dataset.py", line 518, in asseries data = data.append(v) File "/srv/odmf/schwingbach/venv/lib/python3.8/site-packages/pandas/core/series.py", line 2688, in append return concat( File "/srv/odmf/schwingbach/venv/lib/python3.8/site-packages/pandas/core/reshape/concat.py", line 274, in concat op = _Concatenator( File "/srv/odmf/schwingbach/venv/lib/python3.8/site-packages/pandas/core/reshape/concat.py", line 359, in init raise TypeError(msg) TypeError: cannot concatenate object of type '<class 'numpy.ndarray'>'; only Series and DataFrame objs are valid
where function returns an array instead of a Series. Fixed by transforming to series always.
Tested with #1 groundwater head level and #13 discharge Both result in
Error
'DataFrame' object has no attribute 'time'