# 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

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

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

## 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. 
C. [1, 2, 3]
D. Error

## 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]

## 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

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

## 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)

## 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

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

## 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

A. dtype
B. type
C. typei
D. itype

## 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

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

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

A. 0
B. 1
C. 2
D. 3

## 16.Numpy in the Python provides the

A. Function
B. Lambda function
C. Type casting
D. Array

## 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

## 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

## 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

## 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

## 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

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

## 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

## 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

## 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

## 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

## 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

A. access
B. import
C. fetch
D. from

## 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)

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

## 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

A. NPy
B. Rpy
C. Numpy
D. None

A. True
B. False
C. Both A and B
D. None

## 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

A. Indexed
B. Sliced
C. Iterated
D. All of these

A. True
B. False
C. Both A and B
D. None

## 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

## 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

## 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

A. True
B. False
C. Both A and B
D. None

## 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

## 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

## 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

## 44.Numpy developed by?

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

## 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

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

## 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

A. iid_
B. ixd_
C. ix_
D. None of these

## 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

## 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    