BaşlayınÜcretsiz Başlayın

Subsetting 2D arrays

Subsetting 2D arrays is similar to subsetting nested lists. In a 2D array, the indexing or slicing must be specific to the dimension of the array:

array[row_index, column_index]

numpy is imported as np and the 2D array stock_array_transposed (from the previous exercise) is available in your workspace.

Bu egzersiz

Introduction to Python for Finance

kursunun bir parçasıdır
Kursu Görüntüle

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Subset prices from stock_array_transposed
prices = stock_array_transposed[:, ____]
print(prices)
Kodu Düzenle ve Çalıştır