Aan de slagGa gratis aan de slag

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.

Deze oefening maakt deel uit van de cursus

Introduction to NumPy

Cursus bekijken

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Create an array of the first 100 trunk diameters from tree_census
hundred_diameters = ____
print(hundred_diameters)
Code bewerken en uitvoeren