i have two data frames:
df1 :
ID COUNT 0 202485 6 1 215893 8 2 181840 8 3 168337 7
and another dataframe
df2:
ID 0 202485 1 215893 2 181840
i want to filter /left join the two dataframes:
desired result is
ID COUNT 0 202485 6 1 215893 8 2 181840 8
i tried df1.merge(df2, how='inner', on='ID')
: error like ou are trying to merge on object and int64 columns
also used isin
, but didn't work.
list=df1['ID'].drop_duplicates().to_list()
df1[df1['ID'].isin(list)]
Any help?