I want to bring three data frames into a single one .All data frames have a single column .
org_city_id=p.DataFrame(training_data['origcity_id'])
pol_city_id=p.DataFrame(training_data['pol_city_id'])
pod_city_id=p.DataFrame(training_data['pod_city_id'])
All have 100 records in it so my goal is to bring them into a single data frame which will then contain 300 records .My below code is not working
org_city_id.append([pol_city_id,pod_city_id])
the total number of records in org_city_id is still 100 .
Can someone please suggest .
Get a single column name for all your dataframes:
org_city_id.columns = pol_city_id.columns = pod_city_id.columns = 'Final Name'
Then concat them:
pd.concat([org_city_id,pol_city_id,pod_city_id])
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With