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. 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.
3. 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.
4. 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. ])
5. 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.
6. 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
7. 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.])
8. 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.
9. 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.
10. 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.
Discussion