lisa.datautils.series_dereference#
- lisa.datautils.series_dereference(series, sources, inplace=False, method='ffill')[source]#
Replace each value in
series
by the value at the corresponding index by the source indicated byseries
’s value.- Parameters:
series (pandas.Series) – Series of “pointer” values.
sources (collections.abc.Mapping or pandas.DataFrame) –
Dictionary with keys corresponding to
series
values. For each value ofseries
, a source will be chosen and its value at the current index will be used. If apandas.DataFrame
is passed, the column names will be used as keys and the column series as values.Note
Unless
series
and thesources
share the same index, thesources
will be reindexed withffill
method.inplace (bool) – If
True
, modify the series inplace.method (str) –
sources
is reindexed so that it shares the same index asseries
.method
is forwarded topandas.Series.reindex()
.