Finance를 위한 Python 입문
Adina Howe
Professor
S&P 100을 설명하는 NumPy 배열: 이름, 가격, 이익, 섹터
S&P 100 기업의 섹터별 P/E 비율을 탐색하고 분석합니다
stock_prices = np.array([100, 200, 300])
filter_array = (stock_prices >= 150)
print(filter_array)
[ False True True]
stock_prices = np.array([100, 200, 300])
filter_array = (stock_prices >= 150)
print(stock_prices[filter_array])
[200 300]
해당 섹터의 P/E 비율 평균과 표준편차를 계산합니다
import numpy as np
average_value = np.mean(my_array)
std_value = np.std(my_array)
Finance를 위한 Python 입문