निम्नलिखित कोड का परिणाम क्या है ?
What is the output of the following code ?
import numpy as np
a = np.array([[1,2,3]])
print(a.shape)
A)
B)
C)
D)
Explanation:
Let's break it down:
-
Array
a
:a = np.array([[1, 2, 3]])
This creates a 2D array with one row and three columns:
[[1, 2, 3]]
-
Shape of
a
:print(a.shape)
The shape of
a
is(1, 3)
because it has 1 row and 3 columns.
Output: (1, 3)
Answer: (C) (1, 3)