1. 学习
  2. /
  3. 课程
  4. /
  5. Introduction to Python for Finance

Connected

练习

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).

说明 1 / 共 2 个

undefined XP
    1
    2
  • Create a boolean array to determine which elements in sectors are 'Information Technology'.
  • Use the boolean array to subset names and pe in the Information Technology sector.