Advertisements
Advertisements
प्रश्न
Create the following NumPy arrays:
Use nested Python lists to create a 2-D array called myarray1 having 3 rows and 3 columns and store the following data:
| 2.7, | -2, | -19 |
| 0, | 3.4, | 99.9 |
| 10.6, | 0, | 13 |
कोड लेखन
Advertisements
उत्तर
A 2-D NumPy array called myarray1 can be created using nested Python lists as follows:
import numpy as np
myarray1 = np.array
([
[2.7, -2, -19],
[0, 3.4, 99.9],
[10.6, 0, 13]
])
print(myarray1)
Output:
[[2.7. |
-2. |
-19.] |
[0. |
3.4. |
99.9] |
[10.6. |
0. |
|
shaalaa.com
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
