Exercise: Using Conditions on Arrays
In this exercise, you will be using multiple conditions on arrays.
We'll cover the following
Task
In this exercise, you will be using conditions on NumPy arrays.
Problem statement
- Create an array for variable
x
consisting of values from to . - Compute and store it in a variable
y
. - Store all values of
y
that are greater than or less than in one array.
- Store all values of
y
that are greater than and less than in another array.
can be accessed using
np.pi
.
can be used as
np.sin(x)
.
Get hands-on with 1400+ tech skills courses.