I am preparing data for regression but i couldn't do it. I have to covert 2 rows likes and popularity to integer. how can i do it.
Unique_ID int64
Genre int64
Views int64
Comments int64
Likes object
Popularity object
Followers int64
dtype: object
1.I did this:
df['Popularity']=df.Popularity.str.replace(',','').astype(int)
and error came
invalid literal for int() with base 10: '13.1K'
- then I tried this:
pd.to_numeric(df['Likes'], downcast='integer')
again error came
Unable to parse string "2,400" at position 3
- and this as well
df = df.astype(int)
invalid literal for int() with base 10: '2,400'
what can i do so that i can do regression to my data