File size: 486 Bytes
5de7e1c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# -*- 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)