Reputation: 135
Currently my dataframe looks like this,
And I want something like this,
Filename Data_Extracted
file1 data of file1
file2 data of file2
Currently File1 & File2 are actually the columns of the dataframe and data of file1 & file 2 are the records
is there any way to do that?
Upvotes: 0
Views: 77
Reputation: 19565
If your dictionary has the structure {filename1: data1, filename2: data2, ...}
, then you can do something like this:
df = pd.DataFrame(data=filename_dict.items(), columns=['Filename', 'Data_Extracted'])
Upvotes: 1