Python NumPy MCQs

11. Numpy developed by?

A. Guido van Rossum
B. Travis Oliphant
C. Wes McKinney
D. Jim Hugunin

View Answer


12. Which of the following Numpy operation are correct?

A. Mathematical and logical operations on arrays.
B. Fourier transforms and routines for shape manipulation.
C. Operations related to linear algebra.
D. All of the above

View Answer


13. The basic ndarray is created using?

A. numpy.array(object, dtype = None, copy = True, subok = False, ndmin = 0)
B. numpy.array(object, dtype = None, copy = True, order = None, subok = False, ndmin = 0)
C. numpy_array(object, dtype = None, copy = True, order = None, subok = False, ndmin = 0)
D. numpy.array(object, dtype = None, copy = True, order = None, ndmin = 0)

View Answer


14. What will be output for the following code?

import numpy as np 

a = np.array([1, 2, 3,4,5], ndmin = 2) 

print a

A. [[1, 2, 3, 4, 5]]
B. [1, 2, 3, 4, 5]
C. Error
D. Null

View Answer


15. What is the syntax for dtype object?

A. numpy.dtype(object, align, copy, subok)
B. numpy.dtype(object, align, copy)
C. numpy.dtype(object, align, copy, ndmin)
D. numpy_dtype(object, align, copy)

View Answer


16. Which of the following function stacks 1D arrays as columns into a 2D array?

A. row_stack
B. column_stack
C. com_stack
D. All of the above

View Answer


17. Which of the following statement is true?

A. Some ufuncs can take output arguments.
B. Broadcasting is used throughout NumPy to decide how to handle disparately shaped arrays
C. Many of the built-in functions are implemented in compiled C code
D. The array object returned by __array_prepare__ is passed to the ufunc for computation.

View Answer


18. Which of the following set the floating-point error callback function or log object?

A. settercall
B. setterstack
C. setter
D. callstack

View Answer


19. What will be output for the following code?

import numpy as np 

dt = np.dtype([('age',np.int8)]) 

a = np.array([(10,),(20,),(30,)], dtype = dt) 

print a['age']

A. [[10 20 30]]
B. [10 20 30]
C. [10]
D. Error

View Answer


20. What is the range of uint32 data type?

A. (-2147483648 to 2147483647)
B. (-32768 to 32767)
C. (0 to 65535)
D. (0 to 4294967295)

View Answer





Discussion


* You must be logged in to add comment.