預測銷售額
你想透過預測明年的銷售額來規劃明年的營運,因此你已為每個月份與產業蒐集了對應的乘數。這些乘數存放在名為 monthly_industry_multipliers 的陣列中。例如,monthly_industry_multipliers[0, 0] 的值是 0.98,代表酒類零售業預估在明年 1 月的銷售額為今年 1 月的 98%。
array([[0.98, 1.02, 1. ],
[1.00, 1.01, 0.97],
[1.06, 1.03, 0.98],
[1.08, 1.01, 0.98],
[1.08, 0.98, 0.98],
[1.1 , 0.99, 0.99],
[1.12, 1.01, 1. ],
[1.1 , 1.02, 1. ],
[1.11, 1.01, 1.01],
[1.08, 0.99, 0.97],
[1.09, 1. , 1.02],
[1.13, 1.03, 1.02]])
numpy 已替你以 np 載入,且 monthly_sales 與 monthly_industry_multipliers 這兩個陣列都可使用。monthly_sales 的欄位依序代表酒類零售、餐廳,以及百貨公司的銷售額。
本練習屬於課程
NumPy 入門
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Create an array of monthly projected sales for all industries
projected_monthly_sales = ____
print(projected_monthly_sales)