Pandas Left Merge Issue

I have a question regarding page 5 of 'Working with Missing and Duplicate Data" section. My code works in the Dataquest terminal but wouldn’t work when I run it locally. Here’s the issue:

  1. Before I do anything, the “combined” dataframe has as shape of 492 by 17, and the “regions” dataframe 328 by 2.
  2. I left merge them using the following command: combined = pd.merge(left=combined, right=regions, how=‘left’, on = ‘COUNTRY’)
  3. In the Dataquest terminal “combined” becomes 492 by 18 (as intended), but in my local machine it becomes 984 by 18 (with all rows duplicated).

I found this somewhat helpful but it didn’t quite solve the issue. Could someone explain/help? Thank you.

Hey there! Any chance you can link to this mission? I’m afraid I’m looking at the wrong one.

It would also be helpful to know which dataset you were using in your local analysis — did you download it directly from the source or did you download the exact dataset that DQ uses in the missions (via the download icon above the code editor)?