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

blocked insertion of zeros into empty intervals by resample.sum

parent 6661ce46
No related branches found
No related tags found
4 merge requests!193Release 1.4,!188Release 1.4,!49Dataprocessing features,!44Dataprocessing features
Pipeline #4080 passed with stage
in 7 minutes and 22 seconds
......@@ -332,8 +332,12 @@ def _interpolateGrid(
closed = 'right'
# all values in a sampling interval get aggregated with agg_method and assigned to the next grid point
# some consistency cleanup:
# we are not trusting resamples interplay with sum and others - so we check for empty intervals:
to_nan = data.resample(freq_string, loffset=loffset, base=base, closed=closed,
label=label).count() == 0
data = data.resample(freq_string, loffset=loffset, base=base, closed=closed,
label=label).apply(agg_method)
data[to_nan] = np.nan
if total_range is None:
data = data.reindex(ref_index)
......
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