lisa.datautils.series_refit_index#
- lisa.datautils.series_refit_index(series, start=None, end=None, window=None, clip_window=True)[source]#
Slice a series using
series_window()
and ensure we have a value at exactly the specified boundaries, unless the signal started after the beginning of the required window.- Parameters:
df (pandas.Series) – Series to act on
start (object) – First index value to find in the returned series.
end (object) – Last index value to find in the returned series.
window (tuple(float or None, float or None) or None) –
window=(start, end)
is the same asstart=start, end=end
. These parameters styles are mutually exclusive.
Note
If
end
is past the end of the data, the last row will be duplicated so that we can have a start and end index at the right location, without moving the point at which the transition to the last value happened. This also allows plotting series with only one item using matplotlib, which would otherwise be impossible.- Parameters:
clip_window – Passed down to
series_refit_index()
.