import pandas as pd
with open('a.csv', 'r') as a, open('b.csv', 'r') as b, open('c.csv','w') as c:
a_lst = a.readlines(); b_lst = b.readlines(); c_lst = []
for i in range(len(a_lst)):
c_lst.append(a_lst[i].strip() + ',' + b_lst[i].strip())
c.write('\n'.join(c_lst))
df = pd.read_csv('c.csv')
new_order = df[['country','name','region','time','NA','Rupa','home','day']]
new_order.to_csv('c.csv', index=False)
1条答案
按热度按时间e37o9pze1#
我相信有很多更简洁的方法可以做到这一点,但这里有一个快速(和肮脏)的:
输出量: