Python SciPy MCQ Questions And Answers
This section focuses on "Python SciPy" for Data Science. These Python SciPy 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. SciPy stands for?
A. science library
B. source library
C. significant library
D. scientific library
View Answer
Ans : D
Explanation: SciPy, a scientific library for Python is an open source, BSD-licensed library for mathematics, science and engineering.
2. SciPy Original author is?
A. Guido van Rossum
B. Travis Oliphant
C. Wes McKinney
D. Jim Hugunin
View Answer
Ans : B
Explanation: SciPy developed by Travis Oliphant
3. Which of the following is not correct sub-packages of SciPy?
A. scipy.cluster
B. scipy.source
C. scipy.interpolate
D. scipy.signal
View Answer
Ans : B
Explanation: scipy.source is not correct sub-packages of SciPy.
4. The number of axes is called as _____.
A. object
B. Vectors
C. rank
D. matrices
View Answer
Ans : C
Explanation: Dimensions are called as axes. The number of axes is called as rank.
5. Which of the following is true?
A. By default, all the NumPy functions have been available through the SciPy namespace
B. There is no need to import the NumPy functions explicitly, when SciPy is imported.
C. SciPy is built on top of NumPy arrays
D. All of the above
View Answer
Ans : D
Explanation: All statement are correct.
6. What will be output for the following code?
import numpy as np
print np.arange(7)
A. array([0, 1, 2, 3, 4, 5, 6])
B. array(0, 1, 2, 3, 4, 5, 6)
C. [0, 1, 2, 3, 4, 5, 6]
D. [[0, 1, 2, 3, 4, 5, 6]]
View Answer
Ans : A
Explanation: The above program will generate the following output : array([0, 1, 2, 3, 4, 5, 6])
7. What will be output for the following code?
import numpy as np
print np.linspace(1., 4., 6)
A. array([ 1. , 2.2, 2.8, 3.4, 4. ])
B. array([ 1. , 1.6, 2.8, 3.4, 4. ])
C. array([ 1. , 1.6, 2.2, 2.8, 3.4, 4. ])
D. array([ 1. , 1.6, 2.2, 2.8, 4. ])
View Answer
Ans : C
Explanation: The above program will generate the following output : array([ 1. , 1.6, 2.2, 2.8, 3.4, 4. ])
8. Which of the following code is used to whiten the data?
A. data = numpy.whiten(data)
B. data = whiten(data)
C. data =SciPy.whiten(data)
D. data = data.whiten()
View Answer
Ans : B
Explanation: We have to use the following code to whiten the data : data = whiten(data)
9. How to import Constants Package in SciPy?
A. import scipy.constants
B. from scipy.constants
C. import scipy.constants.package
D. from scipy.constants.package
View Answer
Ans : B
Explanation: from scipy.constants is used.
10. What is "h" stand for Constant?
A. Newton's gravitational constant
B. Elementary charge
C. Planck constant
D. Molar gas constant
View Answer
Ans : C
Explanation: h : Planck constant
11. what is constant defined for Boltzmann constant in SciPy?
A. G
B. e
C. R
D. k
View Answer
Ans : D
Explanation: k : Boltzmann constant
12. What is the value of unit milli in SciPy?
A. 0.01
B. 0.1
C. 0.0001
D. 0.001
View Answer
Ans : D
Explanation: milli : 0.001
13. What will be output for the following code?
from scipy import linalg
import numpy as np
a = np.array([[3, 2, 0], [1, -1, 0], [0, 5, 1]])
b = np.array([2, 4, -1])
x = linalg.solve(a, b)
print x
A. array([ 2., -2., 9., 6.])
B. array([ 2., -2., 9.])
C. array([ 2., -2.])
D. array([ 2., -2., 9., -9.])
View Answer
Ans : B
Explanation: The above program will generate the following output : array([ 2., -2., 9.])
14. What will be output for the following code?
from scipy import linalg
import numpy as np
A = np.array([[1,2],[3,4]])
x = linalg.det(A)
print x
A. 2
B. 1
C. -2
D. -1
View Answer
Ans : C
Explanation: The above program will generate the following output : -2.0
15. In SciPy, determinant is computed using?
A. determinant()
B. SciPy.determinant()
C. det()
D. SciPy.det()
View Answer
Ans : C
Explanation: In SciPy, this is computed using the det() function.
16. scipy.linalg always compiled with?
A. BLAS/LAPACK support
B. BLAS/Linalg support
C. Linalg/LAPACK support
D. None of the above
View Answer
Ans : A
Explanation: SciPy.linalg is always compiled with BLAS/LAPACK support, while for NumPy this is optional.
17. Which of the following is false?
A. scipy.linalg also has some other advanced functions that are not in numpy.linalg
B. SciPy version might be faster depending on how NumPy was installed.
C. Both A and B
D. None of the above
View Answer
Ans : D
Explanation: Both statement are true.
18. The scipy.linalg.solve feature solves the _______.
A. integration problem
B. differentiation problem
C. linear equation
D. All of the above
View Answer
Ans : C
Explanation: The scipy.linalg.solve feature solves the linear equation a * x + b * y = Z, for the unknown x, y values .
19. What relation is consider between Eigen value (lambda), square matrix (A) and Eign vector(v)?
A. Av = lambda*v
B. Av =Constant * lambda*v
C. Av =10 * lambda*v
D. Av != lambda*v
View Answer
Ans : A
Explanation: We can find the Eigen values (lambda) and the corresponding Eigen vectors (v) of a square matrix (A) by considering the following relation.
20. What will be output for the following code?
from scipy.special import logsumexp
import numpy as np
a = np.arange(10)
res = logsumexp(a)
print res
A. 10
B. 9.45862974443
C. 9
D. 9.46
View Answer
Ans : B
Explanation: The above program will generate the following output : 9.45862974443
Discussion