1. Learn
  2. /
  3. कोर्स
  4. /
  5. NumPy परिचय

Connected

अभ्यास

पंक्तियों में 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 को दर्शाती हैं।

निर्देश 1/3

undefined XP
    1
    2
    3
  • हर industry के लिए mean sales projection multiplier निकालें; इसे mean_multipliers नाम के array में सहेजें।