I mean I have a column named num_students.
datatype of it is object and for example its written as 2,435
I want to get it as 2435 as object
What im trying to do is:
timesData.num_students = [ each.replace(",","") for each in timesData.num_students]
I get error : AttributeError: 'float' object has no attribute 'replace'
One way to do it using str.replace
,
timesData['num_students'] = timesData['num_students'].str.replace(',', '')
str.replace(',', '') replaces the comma with nothing