Python Programming - Arrays - Discussion
Discussion Forum : Arrays - General Questions (Q.No. 45)
45.
Given a NumPy array
arr = np.array([2, 4, 6, 8, 10])
, how do you extract elements at even indices?
Answer: Option
Explanation:
The code
arr[::2]
extracts elements at even indices from the array.
Discussion:
Be the first person to comment on this question !
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers