Using .loc[ ]
Compito
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.
Soluzione
# 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
Tutto è chiaro?
Grazie per i tuoi commenti!
Sezione 1. Capitolo 7
AVAILABLE TO ULTIMATE ONLY