Open rtbs-dev opened 4 years ago
I think the problem here is apply
uses the function keyword internally, so it clashes with resample's function
.
@philippjfr I'm not sure if that is directly related (unless apply
is being called automatically in other situations):
For instance, this works (i.e. manually creating the NdOverlay):
resample(
tag_timeseries(df, 'tagA')*\
tag_timeseries(df, 'tagB'),
rule='M' # works
)
and this throws the same error
resample(
tag_timeseries(df, 'tagA')*\
tag_timeseries(df, 'tagB'),
rule='M',
function=pd.np.sum # TypeError
)
In the same vein, calling collapse on the above does (seemingly) nothing, just returning hv.Curve.tagA
:
collapse(resample(
tag_timeseries(df, 'tagA')*\
tag_timeseries(df, 'tagB'),
rule='M',
# function=pd.np.sum # TypeError
), fn=pd.np.sum)
I would also note that it's somewhat confusing to have separately named arguments (function
vs. fn
) that both are used in operations to apply functions to elements via operations
ALL software version info (this library, plus any other relevant software, e.g. bokeh, python, notebook, OS, browser, etc)
watermark:
Description of expected behavior and the observed behavior
holoviews.operations.timeseries.resample
should accept arbitrary functions to operate on underlying data, but currently passing any argument to thefunction
kwarg throws a TypeError:Similarly, the
holoviews.operations.collapse
argument appears to have a bug, though not throwing any exceptions. Instead it only plots the first facet of anNdOverlay
, ignoring the summation altogether (see below).Complete, minimal, self-contained example code that reproduces the issue