Aan de slagGa gratis aan de slag

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.

Deze oefening maakt deel uit van de cursus

Introduction to Python for Finance

Cursus bekijken

Oefeninstructies

  • Find elements in sectors that are equivalent to 'Health Care' and assign the result to boolean_array.
  • Subset names using boolean_array and assign the result to health_care.

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Create boolean array
boolean_array = (sectors == ____)
print(boolean_array)

# Print only health care companies
health_care = ____
print(health_care)
Code bewerken en uitvoeren