What is the purpose of broadcasting in NumPy?
Correct answer
A. To adjust array dimensions to perform arithmetic operations
12 views
A. To adjust array dimensions to perform arithmetic operations
12 views
Broadcasting lets NumPy stretch arrays of different shapes so arithmetic can be performed on them. For example, adding a scalar or a 1-D row to a 2-D array applies it across every row, without copying data.
Dimensions are compatible when they are equal or one of them is 1.
Want more practice? Try the full set of Data Science MCQs on MCQsExam.com.
Not sure why the answer is A? Ask here and get an explanation.