Trying to merge 2 dataframes but get ValueError

前端 未结 7 1107
别那么骄傲
别那么骄傲 2020-11-30 04:15

These are my two dataframes saved in two variables:

> print(df.head())
>
          club_name  tr_jan  tr_dec  year
    0  ADO Den Haag    1368    1422          


        
相关标签:
7条回答
  • 2020-11-30 05:14

    At first check the type of columns which you want to merge. You will see one of them is string where other one is int. Then convert it to int as following code:

    df["something"] = df["something"].astype(int)
    
    merged = df.merge[df1, on="something"]
    
    0 讨论(0)
提交回复
热议问题