Search⌘ K
AI Features

Puzzle 1: Rectified

Explore how to solve a pandas puzzle that tests knowledge of relational operators, data manipulation, and datetime handling. Learn to predict outputs and sharpen your problem-solving with pandas dataframes.

We'll cover the following...

Guess the output

Try to guess the output of the code below:

Python 3.5
import pandas as pd
def relu(n):
if n < 0:
return 0
return n
arr = pd.Series([-1, 0, 1])
print(relu(arr))

Quiz

1.

What is the output of code above?

A.

0 0 1

B.

-1 0 1

C.

ValueError

D.

TypeError


1 / 1