I also have the same problem. I tried the code provided as an answer, it works fine.
I just need an explanation of this part of the code that i didn't understand.
dfs = {country: df[df["country"] == country] for country in countries}