Stepping into 2D
Now assume that your research requires you to take an admittedly unrepresentative sample of trunk diameters, which are located in the third column of tree_census
. Getting just a selection of trunk diameters can be done with NumPy's slicing and stepping functionality.
numpy
is loaded as np
, and the tree_census
2D array is available.
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 an array of the first 100 trunk diameters from tree_census
hundred_diameters = ____
print(hundred_diameters)