Merge function - Data Cleaning

Screen Link:
Screen Link

My Code:

>>> combined = pd.merge(left=combined, right=regions, on='COUNTRY', how='left')

What I expected to happen: In Merge function, we are supposed to put two Datasets at Left and right respectively.
But in this code, we put region as right.
But Region is not a dataset, its a subset

Kindly clarify the doubt

Anu

Hello.

So, a subset is still a dataset. In this case, regions is dataframe created from another dataframe, but still a dataframe. Does that make sense for you?

Yes, thank you

I got this line too.
“We’ve already created a dataframe named regions containing all of the countries and corresponding regions from the happiness2015 , happiness2016 , and happiness2017 dataframes.”
Thanks

1 Like

Hi, do you know an efficient way to generate the regions dataframe provided in the mission?
Thanks.