Who's in health care?
In this exercise, you are provided the names of companies with their associated sector, and your goal is to find all companies that are associated with health care sector.
numpy is imported as np and the arrays names and sectors are available in your workspace.
Bu egzersiz
Introduction to Python for Finance
kursunun bir parçasıdırEgzersiz talimatları
- Find elements in
sectorsthat are equivalent to'Health Care'and assign the result toboolean_array. - Subset
namesusingboolean_arrayand assign the result tohealth_care.
Uygulamalı interaktif egzersiz
Bu örnek kodu tamamlayarak bu egzersizi bitirin.
# Create boolean array
boolean_array = (sectors == ____)
print(boolean_array)
# Print only health care companies
health_care = ____
print(health_care)