I'm trying to convert some data to pandas dataframe. Somehow, the dataframe turned out to be empty. The print statement shows the following (part of it)
Empty DataFrame
Columns: []
Index: [count "a" "33" "37" "asd7"]
Empty DataFrame
Columns: []
Index: [data "2434" "33" "37" "[email protected]"]
I'd like to write the dataframe to a csv file. Since the dataframe is empty, can I write the indexes into a csv file like
count,data
a,2434
33,33
37,37
asd7,[email protected]
I know I can write a dataframe to csv using data.to_csv, but how do I achieve the above stated?