from pathlib import Path

def txt_to_df(str_txt):
    # TXTをDataframeに変換する、何らかの処理
    return df

txt_path = Path("./txt/")
all_df = pd.DataFrame()
        
for txt in txt_path.glob("*.txt"):
    
    str_txt = txt.read_text()
    
    df = txt_to_df(str_txt)
    
    all_df = pd.concat([all_df, df])

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です