lisa.datautils.series_dereference#
- lisa.datautils.series_dereference(series, sources, inplace=False, method='ffill')[source]#
Replace each value in
seriesby 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
seriesvalues. For each value ofseries, a source will be chosen and its value at the current index will be used. If apandas.DataFrameis passed, the column names will be used as keys and the column series as values.Note
Unless
seriesand thesourcesshare the same index, thesourceswill be reindexed withffillmethod.inplace (bool) – If
True, modify the series inplace.method (str) –
sourcesis reindexed so that it shares the same index asseries.methodis forwarded topandas.Series.reindex().