Fancy indexing vs. np.where()
You and your tree research team are double-checking collection data by visiting a few trees in person to confirm their measurements. You've been assigned to check the data for trees on block 313879, and you'd like to make a small array of just the tree data that relates to your work.
numpy
is loaded as np
, and the tree_census
array is available. As a reminder, the tree_census
columns in order refer to a tree's ID, its block ID, its trunk diameter, and its stump diameter.
This exercise is part of the course
Introduction to NumPy
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Create the block_313879 array containing trees on block 313879
block_313879 = ____
print(block_313879)