Q:

Following is the provided numPy array. Return array of items by taking the third column from all rows

belongs to collection: Python NumPy Exercises

0

Following is the provided numPy array. Return array of items by taking the third column from all rows

sampleArray = numpy.array([[11 ,22, 33], [44, 55, 66], [77, 88, 99]])

Expected Output:

Printing Input Array
[[11 22 33]
 [44 55 66]
 [77 88 99]]

Printing array of items in the third column from all rows
[33 66 99]

All Answers

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

import numpy

sampleArray = numpy.array([[11 ,22, 33], [44, 55, 66], [77, 88, 99]]) 
print("Printing Input Array")
print(sampleArray)

print("\n Printing array of items in the third column from all rows")
newArray = sampleArray[...,2]
print(newArray)

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

total answers (1)

Return array of odd rows and even columns from bel... >>
<< Create a 4X2 integer array and Prints its attribut...