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

Filtering arrays

In this lesson, you will focus on two sectors:

  • Information Technology
  • Consumer Staples

numpy is imported as np and S&P 100 data is stored as arrays: names, sectors, and pe (price to earnings ratio).

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.

# Create boolean array 
boolean_array = (____ 'Information Technology')

# Subset sector-specific data
it_names = ____
it_pe = ____

# Display sector names
print(it_names)
print(it_pe)
Kodu Düzenle ve Çalıştır