Using .loc[ ]
Taak
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.
Oplossing
# 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
Was alles duidelijk?
Bedankt voor je feedback!
Sectie 1. Hoofdstuk 7
AVAILABLE TO ULTIMATE ONLY