Q:

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

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)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now