I have csv file which is having columns i.e
i want to combine(merge) zipcode, housenumber, street to one column saying address
I can read those file after that i tried the below code its getting error
import pandas as pdimport csvinput= pd.readcsv("/root/demo_stats_extraction/fsm_src/logs/multithread/src/cmts_cm_mapping.csv")df['Address'] = df[df.columns[3:5]].apply(lambda x: ','.join(x.astype(int).astype(str)),axis=1)
please help !!
You can simply do that
df['Address'] = df[df.columns[3:5]].apply(lambda x: ','.join(x.map(str)),axis=1)