page-banner
Chapter-9 NumPy Basics
Q26.
निम्नलिखित कोड का परिणाम क्या है?

What is the output of the following code?
import numpy as np
a = np.array([[1, 2, 3], [4, 5, 6]])
print(a.shape)
A. (2, 3)
B. (3, 2)
C. (1, 1)
D. None of these
View Answer
Q27.
निम्नलिखित कोड का परिणाम क्या है?

What is the output of the following code?
import numpy as np
a = np.array([[1, 2, 3], [0, 1, 4]])
print(a.size)
A. 1
B. 5
C. 6
D. 4
View Answer
Q28.
Python में NumPy ऐरे में ones() फ़ंक्शन का क्या उपयोग है?

What is the use of the ones() function in NumPy array in Python?
A. सभी तत्व 1 के साथ एक मैट्रिक्स बनाने के लिए / To make a matrix with all element 1
B. सभी विकर्ण तत्वों 1 के साथ एक मैट्रिक्स बनाने के लिए / To make a matrix with all diagonal element 1
C. पहली पंक्ति 1 के साथ एक मैट्रिक्स बनाने के लिए / To make a matrix with first row 1
D. इनमें से कोई नहीं / None of these
View Answer
Q29.
निम्नलिखित कोड का आउटपुट क्या है?

What is the output of the following code?
import numpy as np
ary = np.array([4, 5, 6, 7, 8])
ary = ary + 1
print(ary[1])
A. 3
B. 4
C. 5
D. 6
View Answer
Q30.
निम्नलिखित कोड का आउटपुट क्या है?

What is the output of the following code?
import numpy as np
a = np.array([1, 2, 3, 5, 8])
print(a.ndim)
B. 1
C. 2
D. 3
View Answer

Create Account