CommencerCommencer gratuitement

The good old split

You have to do one last task for the obesity project. Your colleague gave you a new dataset to analyze with which you will perform the same analysis as before.

After inspecting the dataset obesity, you realize that you have the same columns as before, but the bounds column is not a list. This time, the column contains two values separated with a hyphen in the form of string.

You will process the string and then transform the column.

The DataFrame obesity is available in your session.

Cet exercice fait partie du cours

Reshaping Data with pandas

Afficher le cours

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

# Split the columns bounds using a hyphen as delimiter
obesity_split = ____[____].____.____(____)

# Print obesity_split
print(obesity_split)
Modifier et exécuter le code