0
Merging Csv columns from multiple files into 1 master file
I need serious help in merging columns of multiple CSV files into 1 master CSV file. These CSV files have 1 common column. Any kind of help is highly appreciated 🙏🙏🙏 Thank you 😌
3 Respuestas
+ 4
First read each csv into a dataframe.
import pandas as pd
df1 =pd.read_csv(filepath)
...
After
mastercsv = pd.concat( (iDF.set_index('name') for iDF in [df1, df2, df3]), axis=1, join='inner' ).reset_index()
Finally save as csv.
mastercsv.to_csv(path)
+ 3
Easily with pandas
Check how to read csv and how to join them.
0
Yes I've tried.
Would you like to invest your time in helping me out?