May-15-2018, 09:59 AM
Without examples of state/city pairs (as int your file) not much I can do, but you really have to learn to work with DataFrame.apply. This is extremely inefficient use of pandas
Test everything in a Python shell (iPython, Azure Notebook, etc.)
- Someone gave you an advice you liked? Test it - maybe the advice was actually bad.
- Someone gave you an advice you think is bad? Test it before arguing - maybe it was good.
- You posted a claim that something you did not test works? Be prepared to eat your hat.