Python NumPy MCQ Questions And Answers

This section focuses on "Python NumPy" for Data Science. These Python NumPy Multiple Choice Questions (MCQ) should be practiced to improve the Data Science skills required for various interviews (campus interview, walk-in interview, company interview), placements, entrance exams and other competitive examinations.

1. NumPY stands for?

A. Numbering Python
B. Number In Python
C. Numerical Python
D. None Of the above

View Answer


2. Numpy developed by?

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

View Answer


3. NumPy is often used along with packages like?

A. Node.js
B. Matplotlib
C. SciPy
D. Both B and C

View Answer


4. 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


5. The most important object defined in NumPy is an N-dimensional array type called?

A. ndarray
B. narray
C. nd_array
D. darray

View Answer


6. 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


7. What will be output for the following code?

import numpy as np 

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

print a

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

View Answer


8. 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


9. What will be output for the following code?

import numpy as np 

a = np.array([1, 2, 3], dtype = complex) 

print a

A. [[ 1.+0.j, 2.+0.j, 3.+0.j]]
B. [ 1.+0.j]
C. Error
D. [ 1.+0.j, 2.+0.j, 3.+0.j]

View Answer


10. 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


11. Which of the following statement is false?

A. ndarray is also known as the axis array.
B. ndarray.dataitemSize is the buffer containing the actual elements of the array.
C. NumPy main object is the homogeneous multidimensional array
D. In Numpy, dimensions are called axes

View Answer


12. 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


13. If a dimension is given as ____ in a reshaping operation, the other dimensions are automatically calculated.

A. Zero
B. One
C. Negative one
D. Infinite

View Answer


14. 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


15. Which of the following sets the size of the buffer used in ufuncs?

A. bufsize(size)
B. setsize(size)
C. setbufsize(size)
D. size(size)

View Answer


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

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

View Answer


17. What will be output for the following code?

import numpy as np 

dt = dt = np.dtype('i4') 

print dt

A. int32
B. int64
C. int128
D. int16

View Answer


18. 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


19. Each built-in data type has a character code that uniquely identifies it.What is meaning of code "M"?

A. timedelta
B. datetime
C. objects
D. Unicode

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.