배열 필터링
이 레슨에서는 아래 두 개 섹터에 집중해 볼 거예요:
- Information Technology
- Consumer Staples
numpy는 np로 임포트되어 있고, S&P 100 데이터는 배열 names, sectors, pe(주가수익비율)로 저장되어 있어요.
이 연습은 강의의 일부입니다
Finance를 위한 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)