1 min readJun 6, 2020
Hi Rajesh, thank you for reading my article! There are 63 missing values for the ‘country’, which explains the mismatch. You can fix this by imputing the 63 missing country values. You can add the following before the function definition: df[‘country’].fillna(df[‘country’].mode()[0], inplace = True)