Using .loc[ ]
Tarea
Swipe to start coding
- Create a variable
X
to store the values of the'text'
column. - Create a variable
y
to store the values of the'class'
column.
Solución
9
1
2
3
4
5
6
# Store the 'text' column
X = df.loc[:, 'text']
# Store the 'class' column
y = df.loc[:, 'class']
print(f"Shape of X: {X.shape}\nshape of y: {y.shape}")
Mark tasks as Completed
¿Todo estuvo claro?
¡Gracias por tus comentarios!
Sección 1. Capítulo 7
Pregunte a AI
Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla