Lately I got stuck trying to find an elegant solution to the following problem:
I have a Series object (pandas.core.series.Series) with the following values (e.g.) -
{1,43234,2,653543,3,436546}
I have another datasource on which I want to iterate, and for that I would like to create a dictionary out of the series, with the following format -
{1:43234,2:653543,3:436546}
Using the function .to_dict is not suitable as it auto-generates the keys.
Can anyone offer an idea?
Thank you all in advance!
{k:v for k, v in zip(s[::2], s[1::2])}...?