datamuxer.DataMuxer.bin_by_edges¶
-
DataMuxer.
bin_by_edges
(bin_edges, bin_anchors, interpolation=None, agg=None, use_cols=None)[source]¶ Return data resampled into bins with the specified edges.
Parameters: - bin_edges (list) – list of two-element items like [(t1, t2), (t3, t4), ...]
- bin_anchors (list) – These are time points where interpolated values will be evaluated. Bin centers are usually a good choice.
- interpolation (dict, optional) –
Override the default interpolation (upsampling) behavior of any data source by passing a dictionary of source names mapped onto one of the following interpolation methods.
- {None, ‘linear’, ‘nearest’, ‘zero’, ‘slinear’, ‘quadratic’,
- ‘cubic’}
None means that each time bin must have at least one value. See scipy.interpolator for more on the other methods.
- agg (dict, optional) – Override the default reduction (downsampling) behavior of any data source by passing a dictionary of source names mapped onto any callable that reduces multiple data points (of whatever dimension) to a single data point.
- use_cols (list, optional) – List of columns to include in binning; use all columns by default.
Returns: resampled_df
Return type: pandas.DataFrame
References
http://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.interp1d.html