List to Dict

I have a table with a list of scientific names that I want to replace with their generic names. I found the unique values in the list, exported to CSV, opened in excel and then wrote in their corresponding generic names. Like Biceps Brachiis is Biceps. Then I reimported into pandas to replace all the scientific names in the table with the generic names.

My issue came in coverting my two lists into a dictionary to use the panda.DataFrame.replace() function. StackOverflow to the rescue yet again! I’m am beyond happy the owners of this website have decided to always make this free. Continue reading