pandas
s = pd.Series(my_dict)
pd.Series(
np.concatenate(s.values),
s.index.repeat(s.str.len())
)
1 964725688
1 6928857
22 1667906
22 35207807
22 685530997
22 35207807
dtype: int64
!
numpy
values = list(my_dict.values())
lens = [len(value) for value in values]
keys = list(my_dict.keys())
pd.Series(np.concatenate(values), np.repeat(keys, lens))
1 964725688
1 6928857
22 1667906
22 35207807
22 685530997
22 35207807
dtype: int64
pd.concat
pd.concat({k: pd.Series(v) for k, v in my_dict.items()}).reset_index(1, drop=True)
1 964725688
1 6928857
22 1667906
22 35207807
22 685530997
22 35207807
dtype: int64