Python เบื้องต้นสำหรับการเงิน
Adina Howe
Professor
อาร์เรย์ NumPy ของข้อมูล S&P 100: ชื่อ, ราคา, กำไร, เซกเตอร์
สำรวจและวิเคราะห์อัตราส่วน P/E รายเซกเตอร์ของบริษัทใน S&P 100
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)
Python เบื้องต้นสำหรับการเงิน