複数の同じ形式のファイルを一気に取り込んでDFを作成したい場合 2022年2月9日 / 1 min read View more blogs with the tag pandas , View more blogs with the tag python Table of Contents #はじめに #方法 はじめに Pythonで複数の同じ形式のファイルを一気に取り込んでDFを作成する方法です。 方法 import glob, osimport pandas as pd # ディレクトリの設定os.chdir('hoge/fuga') # ファイルを連結してDF作成df = pd.DataFrame(columns=[])for file in glob.glob('\*.csv'): tmp = pd.read_csv(file, header=None) df = pd.concat([df, tmp])