Jan-28-2023, 07:47 PM
Hi there. I am working on a project on loan defaults and I am trying to convert the term variable into 36 or 60 integer numeric data type using .apply() or .map().
This is my code
loans['term'] = loans['term'].apply(lambda term: int(term[:3]))
and it is returning the error that the float object is not subscriptable. How do I fix this so I can proceed?
Thank you!
This is my code
loans['term'] = loans['term'].apply(lambda term: int(term[:3]))
and it is returning the error that the float object is not subscriptable. How do I fix this so I can proceed?
Thank you!