I've been trying to change from object to int64 but I got this error message, how can i solve this issue?
df.head()
df.info()
df_int = df['상담신청 유저획득 단가'].astype(int)
ValueError: invalid literal for int() with base 10: '3,119'
I've been trying to change from object to int64 but I got this error message, how can i solve this issue?
df.head()
df.info()
df_int = df['상담신청 유저획득 단가'].astype(int)
ValueError: invalid literal for int() with base 10: '3,119'
Your 3rd column is of type object
, meaning it is not an integer because it has a comma in it. You can treat the type object
as type string
or convert it to string, and remove the comma using the str.replace(",","")
syntax, and then convert the string to integer.