Unhashable type error: list
<p>I have a piece of text and I am trying to list all of the countries mentioned in the text using the wikipedia-iso countries csv list as reference. I have loaded and split the text into a list of words, and loaded the wikipedia csv file and converted the required column to a set with the idea of iterating through both lists and printing a country if it appears in both lists but I am getting the unhashable error, below is my code:</p>

<pre><code>text = pd.read_sql(select_string, con)
ftext = text['SomeText'].str.split()
country_codes = pd.read_csv('wikipedia-iso-country-codes.csv')
ccs = set(country_codes['English short name lower case'])
for country in ftext:
    if country in ccs:                  #this is where the error occurs
       print(country+'  is in the text')
</code></pre>

<p>As far as I can tell, the line:"if country in ccs:" is where the error occurs. Any help would be most appreciated...thanks.</p>