@hemantsain55 wrote:
I have an object type column named gender containing 3 distinct values i.e male, female and other.
when I’m feeding this column to my linear regression its throwing an error ‘’ ValueError: could not convert string to float: ‘other’’I’m new to python so i just want to ask that, does python needs all the column to be numeric(float64) format? Does it cant handle object or category type variables ? if not then why these data types exits, earlier i was working on R and i used to feed multiple type of variables including numeric, categorical and it used tp treat them accordingly without an error so i’m just confused whether i shall look into my code or this error is caused by variable type only.
Thanks in Advance
Posts: 3
Participants: 2