I'm just discovering pandas, I tried to google the error but I found nothing. When I try to calculate this: X = (X - X.min()) / (X.max() - X.min())
knowing that ( X = titanic[['sex','age','fare','class','embark_town','alone']].copy())
I get this: enter image description here
Please any suggestions to correct it?
At least the error is telling you that you can not use "-" operator to the boolean type of operators. So it seems that X.min() equals to True or False.
You should normalize numerical features only (like fare in the Titanic dataset).
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.