NumPy

Question 1
Marks : +2 | -2
Pass Ratio : 100%
Point out the wrong statement.
Each universal function takes array inputs and produces array outputs
Broadcasting is used throughout NumPy to decide how to handle disparately shaped arrays
The output of the ufunc is necessarily an ndarray, if all input arguments are ndarrays
All of the mentioned
Explanation:
The output of the ufunc is not necessarily an ndarray, if all input arguments are not ndarrays.
Question 2
Marks : +2 | -2
Pass Ratio : 100%
___________ decompose the elements of x into mantissa and twos exponent.
trunc
fmod
frexp
ldexp
Explanation:
fmod function return the element-wise remainder of division.
Question 3
Marks : +2 | -2
Pass Ratio : 100%
Which of the following returns an array of ones with the same shape and type as a given array?
all_like
ones_like
one_alike
all of the mentioned
Explanation:
The optional output arguments of the function can be used to help you save memory for large calculations.
Question 4
Marks : +2 | -2
Pass Ratio : 100%
Which of the following sets the size of the buffer used in ufuncs?
bufsize(size)
setsize(size)
setbufsize(size)
all of the mentioned
Explanation:
Adjusting the size of the buffer may therefore alter the speed at which ufunc calculations of various sorts are completed.
Question 5
Marks : +2 | -2
Pass Ratio : 100%
Point out the correct statement.
NumPy main object is the homogeneous multidimensional array
In Numpy, dimensions are called axes
Numpy array class is called ndarray
All of the mentioned
Explanation:
The number of axes is called rank.
Question 6
Marks : +2 | -2
Pass Ratio : 100%
Point out the wrong statement.
A universal function is a function that operates on ndarrays in an element-by-element fashion
In Numpy, universal functions are instances of the numpy.ufunction class
Many of the built-in functions are implemented in compiled C code
All of the mentioned
Explanation:
ufunc instances can also be produced using the frompyfunc factory function.
Question 7
Marks : +2 | -2
Pass Ratio : 100%
Which of the following method creates a new array object that looks at the same data?
view
copy
paste
all of the mentioned
Explanation:
The copy method makes a complete copy of the array and its data.
Question 8
Marks : +2 | -2
Pass Ratio : 100%
ndarray.dataitemSize is the buffer containing the actual elements of the array.
True
False
Explanation:
ndarray.data is the buffer containing the actual elements of the array.
Question 9
Marks : +2 | -2
Pass Ratio : 100%
The ________ function returns its argument with a modified shape, whereas the ________ method modifies the array itself.
reshape, resize
resize, reshape
reshape2, resize
all of the mentioned
Explanation:
If a dimension is given as -1 in a reshaping operation, the other dimensions are automatically calculated.
Question 10
Marks : +2 | -2
Pass Ratio : 100%
Point out the wrong statement.
ipython is an enhanced interactive Python shell
matplotlib will enable you to plot graphics
rPy provides a lot of scientific routines that work on top of NumPy
all of the mentioned
Explanation:
SciPy provides a lot of scientific routines that work on top of NumPy.