'''
Looking at country spellings

Having tidied your DataFrame and checked the data types, your next task in the data 
cleaning process is to look at the 'country' column to see if there are any special 
or invalid characters you may need to deal with.

It is reasonable to assume that country names will contain:

The set of lower and upper case letters.
Whitespace between words.
Periods for any abbreviations.
To confirm that this is the case, you can leverage the power of regular expressions 
again. For common operations like this, Python has a built-in string 
method - str.contains() - which takes a regular expression pattern, and applies it 
to the Series, returning True if there is a match, and False otherwise.

Since here you want to find the values that do not match, you have to invert the 
boolean, which can be done using ~. This Boolean series can then be used to get the
Series of countries that have invalid names.

INSTRUCTIONS
100 XP
Create a Series called countries consisting of the 'country' column of gapminder.
Drop all duplicates from countries using the .drop_duplicates() method.
Write a regular expression that tests your assumptions of what characters belong in 
countries:
Anchor the pattern to match exactly what you want by placing a ^ in the beginning 
and $ in the end.
Use A-Za-z to match the set of lower and upper case letters, \. to match periods, 
and \s to match whitespace between words.
Use str.contains() to create a Boolean vector representing values that match the 
pattern.
Invert the mask by placing a ~ before it.
Subset the countries series using the .loc[] accessor and mask_inverse. Then hit 
'Submit Answer' to see the invalid country names!
'''
