Python Numpy quiz – 50 Question (mY Programming School)

Click on the Start button and start your Python Numpy Quiz.

Learn here complete information about Python Numpy.

Contents

1.NumPY stands for?

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

2.NumPy is often used along with packages like?

A. Node.js
B. Matplotlib
C. SciPy
D. Both B and C
Answer (D)

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

A. ndarray
B. narray
C. nd_array
D. darray
Answer (A)

4.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
Answer (C)

5.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]
Answer (D)

6.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
Answer (A)

7.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
Answer (C)

8.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)
Answer (C)

9.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
Answer (A)

10.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
Answer (B)

11.How we can convert the Numpy array to the list in python?

A. list(array)
B. list.array
C. array.list
D.None of the above
Answer (A)

12.How we can find the type of numpy array in python?

A. dtype
B. type
C. typei
D. itype
Answer (A)

13.How we install Numpy in the system?

A. install numpy
B. pip install python numpy
C. pip install numpy
D. pip install numpy python
Answer (C)

14.It is possible to convert the Numpy array to list in python?

A. Yes
B. No
C. Sometimes
D. None of the above
Answer (A)

15.Minimum number of argument to pass in full() function in Numpy array?

A. 0
B. 1
C. 2
D. 3
Answer (C)

16.Numpy in the Python provides the

A. Function
B. Lambda function
C. Type casting
D. Array
Answer (D)

17.Numpy.array(list), what it does ?

A. It convert array to list
B. It convert list to array
C. It convert array to array
D. Error
Answer (B)

18.Shape() function in Numpy array is used to

A. Find the shape of the array
B. Change the shape of the array
C. Both of the above
D. None of the above
Answer (D)

19.What is the use of the size attribute in Numpy array in python?

A. It find the direction
B. It find the number of items
C. It find the shape
D. All of the above
Answer (B)

20.What is the use of the zeros() function in Numpy array in python ?

A. To make a Matrix with all element 0
B. To make a Matrix with all diagonal element 0
C. To make a Matrix with first row 0
D. None of the above
Answer (A)

21.Which of the following argument we need to pass in reshape() function?

A. Array
B. Shape
C. only array
D. Both array and shape
Answer (D)

22.Which of the following counts the number of elements in Numpy array ?

A. count()
B. return()
C. shape()
D. size()
Answer (D)

23.Which of the following find the maximum number in the Numpy array?

A. max(array)
B. array.max()
C. array(max)
D. None of the above
Answer (B)

24.Which of the following is correct way to import the Numpy module in your program ?

A. import numpy
B. import numpy as np
C. from numpy import *
D. All of the above
Answer (D)

25.Which of the following is not valid to import the numpy module ?

A. import numpy as np
B. import numpy as n
C. import numpy as p
D. None of the above
Answer (D)

26.Which of the following is the essential argument to pass in full() function of Numpy array ?

A. shape
B. value
C. Both of the above
D. None of the above
Answer (C)

27.Which of the following is used to convert the list data type to the Numpy array?

A. array(list)
B. array.list
C. Numpy.array(list)
D. None of the above
Answer (C)

28.Which of the following keyword is used to access the numpy module in python?

A. access
B. import
C. fetch
D. from
Answer (B)

29.Correct syntax of the reshape() function in Numpy array python is –

A. array.reshape(shape)
B. reshape(shape,array)
C. reshape(array,shape)
D. reshape(shape)
Answer (C)

30.How we can change the shape of the Numpy array in python?

A. By Shape()
B. By reshape()
C. By ord()
D. By change()
Answer (B)

31.What is the purpose of NumPy in Python?

A. To do numerical calculations
B. To do scientific computing
C. Both A and B
D. None
Answer (C)

32.Amongst which Python library is similar to Pandas?

A. NPy
B. Rpy
C. Numpy
D. None
Answer ( )

33.NumPy package is capable to do fast operations on arrays.

A. True
B. False
C. Both A and B
D. None
Answer (A)

34.Amongst which of the following is true with reference to Pip in Python?

A. Pip is a standard package management system
B. It is used to install and manage the software packages written in Python
C. Pip can be used to search a Python package
D. All of these
Answer (D)

35.NumPy arrays can be

A. Indexed
B. Sliced
C. Iterated
D. All of these
Answer (D)

36.Binomial Distribution is a Discrete Distribution.

A. True
B. False
C. Both A and B
D. None
Answer (A)

37.Using ndim we can find –

A. We can find the dimension of the array
B. Size of array
C. Operational activities on Matrix
D. None
Answer (A)

38.Observe the following code and identify what will be the outcome?

import numpy as np
a=np.array([1,2,3,4,5,6])
print(a)
A. [1 2 3 4 5]
B. [1 2 3 4 5 6]
C. [0 1 2 3 4 5 6]
D. None of the mentioned above
Answer (B)

39.Observe the following code and identify what will be the outcome?

import numpy as np
a = np.array([[ 0, 1, 2, 3],
[ 4, 5, 6, 7],
[ 8, 9, 10, 11]])
b = a
b is a
A. True
B. False
C. Both A and B
D. None
Answer (A)

40.The ix_ function can be used to combine different vectors.

A. True
B. False
C. Both A and B
D. None
Answer (A)

41.What will be the output of the following Python code?

from numpy import random
x = random.randint(100)
print(x)
A. 56
B. 26
C. 40
D. All of these
Answer (D)

42.Observe the code and identify the outcome:

from numpy import random
x = random.binomial(n=100, p=0.5, size=10)
print(x)
A. [41 53 50 52 60 47 50 50 50 46]
B. [50 52 60 47 50 50 50 46]
C. [41 53 50 52 60 47 50]
D. None of the mentioned above
Answer (A)

43.What will be the output of following Python code?

import numpy as np
a = np.array([(10,20,30)])
print(a.itemsize)
A. 10
B. 9
C. 8
D. All of the mentioned above
Answer (C)

44.Numpy developed by?

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

45.Which of the following Numpy operation are correct?

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

46.NumPy is often used along with packages like?

A. Node.js
B. SciPy
C. Matplotlib
D. Both B and C
Answer (D)

47.Which of the following is contained in NumPy library?

A. fourier transform
B. n-dimensional array object
C. tools for integrating C/C++ and Fortran code
D. All of the mentioned above
Answer (D)

48.Which of the following function can be used to combine different vectors so as to obtain the result for each n-uplet?

A. iid_
B. ixd_
C. ix_
D. None of these
Answer (C)

49.Which of the following sets the size of the buffer used inufuncs?

A. setsize(size)
B. bufsize(size)
C. setbufsize(size)
D. All of these
Answer (C)

50.Which of the following functions stacks 1D arrays as column into a 2D array?

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

Pramod Kumar Yadav is from Janakpur Dham, Nepal. He was born on December 23, 1994, and has one elder brother and two elder sisters. He completed his education at various schools and colleges in Nepal and completed a degree in Computer Science Engineering from MITS in Andhra Pradesh, India. Pramod has worked as the owner of RC Educational Foundation Pvt Ltd, a teacher, and an Educational Consultant, and is currently working as an Engineer and Digital Marketer.



Leave a Comment