पंक्तियों में Broadcasting
पिछले अभ्यास सेट में, आपने monthly_industry_multipliers का उपयोग करके sales की भविष्यवाणी की थी। याद करें कि monthly_industry_multipliers ऐसा दिखता है:
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]])
मान लीजिए आप अपने अनुमानों में इतनी बारीकी से जाना नहीं चाहते। इसकी बजाय, आप monthly_industry_multipliers से हर industry के लिए एक औसत multiplier निकालना चाहते हैं। फिर उसी multiplier का उपयोग करके अगले वर्ष की sales प्रोजेक्ट करेंगे।
numpy आपके लिए np नाम से लोड है, और monthly_sales तथा monthly_industry_multipliers arrays उपलब्ध हैं। monthly_sales की कॉलम क्रमशः liquor store, restaurant, और department store की sales को दर्शाती हैं।
यह अभ्यास पाठ्यक्रम का हिस्सा है
NumPy परिचय
इंटरैक्टिव व्यावहारिक अभ्यास
इस अभ्यास को इस नमूना कोड को पूरा करके आज़माएँ।
# Find the mean sales projection multiplier for each industry
mean_multipliers = ____
print(mean_multipliers)