LibriS2S / alignments /concat_csv.py
PedroDKE's picture
Allignment files
5de7e1c
raw history blame
No virus
486 Bytes
# -*- coding: utf-8 -*-
# this file takes all the De EN mapping and concatenates those
import glob
import pandas as pd
folders = glob.glob('*/')
total = 0
dataframes = []
for fol in folders:
result = glob.glob(fol+'/*.csv')
for f in result:
df = pd.read_csv(f, index_col=0)
df.insert(0, 'book_id', df['book'][0].split('.')[0])
dataframes.append(df)
all_df = pd.concat(dataframes, ignore_index=True)
all_df.to_csv('all_de_en_alligned2.csv',index=False)