Q:

Create a 5X2 integer array from a range between 100 to 200 such that the difference between each element is 10

0

Create a 5X2 integer array from a range between 100 to 200 such that the difference between each element is 10

Expected Output:

Creating 5X2 array using numpy.arange
[[100 110]
 [120 130]
 [140 150]
 [160 170]
 [180 190]]

All Answers

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

Solution:

import numpy

print("Creating 5X2 array using numpy.arange")
sampleArray = numpy.arange(100, 200, 10)
sampleArray = sampleArray.reshape(5,2)
print (sampleArray)

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