🚀 Hurry! Offer Ends In
00 Days
00 Hours
00 Mins
00 Secs
Enroll Now
X

निम्नलिखित आदेशों को क्रियान्वित करने पर, numpy में प्रसारण का उत्पादन होगा

On executing the following commands, Broadcasting in numpy will produce

a = np.array((0,10,20,30))
b = np.array((0,1,2)) 
y = a[:, None] + b
A)
B)
C)
D)

Explanation:

The operation a[:, None] + b adds b (shape (3,)) to each element of a (shape (4,)) by broadcasting. This creates a (4, 3) array:

[[ 0  1  2]
 [10 11 12]
 [20 21 22]
 [30 31 32]]

So, the correct answer is (D).

Latest Updates