DataFrame.apply converts integer data to float even in absence of mixed numerical types
I am using DataFrame.apply()
to calculate a new “Metric” column by taking an existing integer categorical column and looking up the integer in a list, i.e., indexing into the list. It works fine when I use list comprehension, but when I use DataFrame.apply()
, I get an error about the integer being used as an index is not an integer.