哪些公司属于医疗保健?
在本练习中,已为您提供公司名称及其所属行业。您的目标是找出所有属于医疗保健行业的公司。
numpy 已以 np 导入,数组 names 和 sectors 已在您的工作区可用。
本练习是课程的一部分
Python 金融入门
练习说明
- 找出
sectors中等于'Health Care'的元素,并将结果赋给boolean_array。 - 使用
boolean_array对names进行子集选择,并将结果赋给health_care。
交互式实操练习
通过完成这段示例代码来试试这个练习。
# Create boolean array
boolean_array = (sectors == ____)
print(boolean_array)
# Print only health care companies
health_care = ____
print(health_care)