Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
import pandas as pdSeries to dict¶
s = pd.Series(["how", "are", "you"])
s0 how
1 are
2 you
dtype: objects.to_dict(){0: 'how', 1: 'are', 2: 'you'}dict to Series¶
dic = {"how": 0, "are": 2, "you": 1}
dic{'how': 0, 'are': 2, 'you': 1}pd.Series(dic)how 0
are 2
you 1
dtype: int64