I am merging two data frames, but when I try to only include two columns I get an error.
df_cluster_centers.merge(df_inventory_location_info[['Total Cost']],
right_on=['Latitude','Longitude'],
left_on = ['Cluster Latitude','Cluster Longitude'],
how = 'left')
KeyError: 'Latitude'
When I take out [['Total Cost']] it merges fine, but then I have to drop all the other columns. I just want to know why it doesn't work.