Question: Using Python Given the following integer array from a range between 100 to 200 that the difference between each element is 10. Reshape to the

Using Python Given the following integer array from a range between 100 to 200 that the difference between each element is 10. Reshape to the following 5X2 dimention array. [[100 110] [120 130] [140 150] [160 170] [180 190]] Complete the codes as indicated, to print numpy array attributes (use function and dynamic coding. Hard coded answer will not receive credit) Length of each element of array in bytes is: 4 Array Shape is: (5, 2) Array dimensions are: 2 The datatype of the array is: int32 or int64 (32 or 64 dpending on the operating system) hint: consider using arange (code already provided) together with reshape function. arange can be used to create 10X1 array then use reshape to conver to 5X2 array. Use print function to print the above message.

print("Creating 5X2 array using numpy.arange")

sampleArray = np.arange(100, 200, 10) sampleArray = sampleArray.reshape(5,2)

print("Printing Array") print(sampleArray) print("Printing numpy array Attributes") print("1. Length of each element of array in bytes is: ", sampleArray.itemsize) # answer already provided, as example of dynamic coding

# provide your answer as indicated below print("2. Array Shape is: ", #provide answer here print("3. Array dimensions are: ", #provide answer here print("4. The datatype of the array is: ", #provide answer here

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!