SciPy MCQ

Correct Answer : Option (B) :   loadmat()

  Show Answer
2 .
What is a correct syntax to return the mathematical number PI from the constants module, if the module is imported like this :
 
from scipy import constants

Correct Answer : Option (C) :   constants.pi

  Show Answer
3 .
What is a correct syntax to a list of all units under the constants module, if the module is imported like this:
 
from scipy import constants

Correct Answer : Option (A) :   dir(constants)

  Show Answer
4 .
What will be output for the following code?
 
import numpy as np
print np.linspace(1., 4., 6)

Correct Answer : Option (D) :   array([ 1. , 1.6, 2.2, 2.8, 3.4, 4. ])

  Show Answer
5 .
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

Correct Answer : Option (C) :   array([ 2., -2., 9.])


Explaination : The above program will generate the following output : array([ 2., -2., 9.])

  Show Answer
6 .
What is a correct syntax to return the speed of sound (in meters per seconds), if the module is imported like this:
 
from scipy import constants

Correct Answer : Option (B) :   constants.speed_of_sound

  Show Answer
7 .
What will be output for the following code?
 
import numpy as np
print np.arange(7)

Correct Answer : Option (D) :   array([0, 1, 2, 3, 4, 5, 6])

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

Correct Answer : Option (A) :   9.45862974443

  Show Answer
9 .
When working with constanst, what would be the result of the following:
 
constants.kilo

Correct Answer : Option (D) :   1000.0

  Show Answer
10 .
When working with constanst, what would be the result of the following:
 
constants.gram

Correct Answer : Option (C) :   0.001

  Show Answer