開始使用免費開始

篩選陣列

在本課中,你將聚焦於兩個產業別:

  • Information Technology
  • Consumer Staples

已將 numpynp 匯入,且 S&P 100 的資料已存為陣列:namessectorspe(本益比,price to earnings ratio)。

本練習屬於課程

Python 金融入門

檢視課程

動手互動練習

試著完成這個範例程式碼,體驗一下這個練習。

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

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

# Display sector names
print(it_names)
print(it_pe)
編輯並執行程式碼