Q:

Write a NumPy program to find the 4th element of a specified array

0

Write a NumPy program to find the 4th element of a specified array.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

import numpy as np
x = np.array([[2, 4, 6], [6, 8, 10]], np.int32)
print(x)
e1 = x.flat[3]
print("Forth e1ement of the array:")
print(e1)

Sample Output:

[[ 2  4  6]                                                            
 [ 6  8 10]]                                                           
Forth e1ement of the array:                                            
6

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now