MulaiMulai sekarang secara gratis

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.

Latihan ini adalah bagian dari kursus

Introduction to NumPy

Lihat Kursus

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

# Create the block_313879 array containing trees on block 313879
block_313879 = ____
print(block_313879)
Edit dan Jalankan Kode