I have 4 CSV files with thousands of lines so I will make a quick replica of those here.
'zip','econ_risk_score'
'22011','5'
'zip','food_risk_score'
'22011','2'
'zip','healthlit_risk_score'
'22011','4'
'zip','housing_risk_score'
'22011','5'
my result table should look like this
'zip','econ_risk_score','food_risk_score','healthlit_risk_score','housing_risk_score'
'22011','5','2','4','5'
so far this is my code but I keep getting the error
merge() missing 1 required positional argument: 'right' and can't seem to fix it.
Please let me know your thoughts, thanks
import pandas as pd
df1= pd.read_csv('econ_risk_zip.csv')
df2= pd.read_csv('food_risk_zip.csv')
df3= pd.read_csv('health_risk_zip.csv')
df4= pd.read_csv('housing_risk_zip.csv')
df = pd.merge([df1,df2,df3,df4], right_on = 'zip')
df.to_csv('risk_combined.csv')