Correcting and converting height column
So, as you can see, each height has ' cm' in the end, which makes this column non-numeric. Read the instruction how you can handle with this.
Compito
Swipe to start coding
- Remove
' cm'
in each observation in Height column and convert it toint
type. - Print first 10 observations to check correctness.
Soluzione
9
1
2
3
4
5
# replace Height column with modified version
data["Height"] = data["Height"].map(lambda x: x.strip(' cm')).map(int)
# print first 10 heights
data["Height"].head(10)
Mark tasks as Completed
Tutto è chiaro?
Grazie per i tuoi commenti!
Sezione 1. Capitolo 4
single
9
1
taskCode
Chieda ad AI
Chieda ad AI
Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione