Reaz
Reaz

Reputation: 1

ValueError: can not merge DataFrame with instance of type <class 'str'>

I have two dfs: df_main_lat_lon and df_lat_lat_lon. They are as follows: enter image description here

enter image description here

When I merged these two dfs as:

merged_inner = pd.merge('df_tp_lat_lon', 'df_main_lat_lon', on=['LATITUDE', 'LONGITUDE'], how='inner')

I received following error: ValueError: can not merge DataFrame with instance of type

Anyone can help me to solve this issue? Thank you in advance.

Upvotes: 0

Views: 230

Answers (1)

Aytaj Aghabayli
Aytaj Aghabayli

Reputation: 11

Try

merged_inner = pd.merge(df_tp_lat_lon, df_main_lat_lon, on=['LATITUDE', 'LONGITUDE'], how='inner')

DataFrame names should not be indicated as a string.

Upvotes: 1

Related Questions