I have some python code that create a dictionary where the key is followed with the value of a variable length array that contains pandas series.
{"key1":[series1,series2,series3], "key2":[series4,series5,series6,..],...}
All dataframes contains 2 columns, Word and frequency
I was wondering what will be the most appropriate method to convert this data structure to a csv. In the following format.
key, Word, frequency
key1, series1[0][0], series1[0][1]
key1, series1[1][0], series1[1][1]
......
key10, series76[100][0], series76[100][1] #<-Arbitrary indexes.
I have tried iterating through the dictionary and doing it like that. However remnants of the series gets saved to the CSV such as
Length: 65, dtype: int64]
Therefore ideally I would like to use pandas.to_csv() in this scenario in order to not need to manually parse this data.