Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Leer Using .loc[ ] | Identifying Spam Emails
Identifying Spam Emails

book
Using .loc[ ]

Taak

Swipe to start coding

  1. Create a variable X to store the values of the 'text' column.
  2. 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?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 1. Hoofdstuk 7
AVAILABLE TO ULTIMATE ONLY
some-alt