I often forget it, so make a note
import pandas as pd
# list
files=['a.txt', 'b.jpg', 'c.cvs', 'd.xls']
print(type(files))
#Convert to data frame
files_df = pd.DataFrame({'files':files})
print(files_df)
print(type(files_df))
result
<class 'list'>
files
0 a.txt
1 b.jpg
2 c.cvs
3 d.xls
<class 'pandas.core.frame.DataFrame'>
Recommended Posts