LoginSignup
18
13

More than 3 years have passed since last update.

pythonでlistをDataFrameに変換する

Last updated at Posted at 2019-12-06

よく忘れるのでメモ

import pandas as pd

# list
files=['a.txt', 'b.jpg', 'c.cvs', 'd.xls']

print(type(files))

# データフレームに変換
files_df = pd.DataFrame({'files':files})
print(files_df)
print(type(files_df))

結果

<class 'list'>
   files
0  a.txt
1  b.jpg
2  c.cvs
3  d.xls
<class 'pandas.core.frame.DataFrame'>
18
13
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
18
13