What are the best first steps when diagnosing AttributeError: 'str' object has no attribute 'str' error

First I create a data set using pandas function pd.read_sql(). As far as I know, all imported columns are strings. Then I create a new null variable and define a function, like so (tinyurl.com/tnr...