Question: Load the Numpy library before you start: [ ] : # Load the library Create Some Arrays Create ( and show ) an array with

Load the Numpy library before you start:
[]:
# Load the library
Create Some Arrays
Create (and show) an array with elements from 5 to 7(not included) in steps of 0.25:
[]:
# 5 to (less than)7:
Create and show an array with 23 evenly spaced values from 3 to 4, inclusive:
[]:
# 23 points from 3 to 4:
Make and show a 45 two-dimensional array of zeros: (Don't do it by entering all values manually)
[]:
# 4x5 zeros:
Indexing an Array
Run the cell below to define and display a matrix mat:
[]:
mat = np.arange(1,101).reshape(10,10)
print(mat)
Use matrix indexing to retrieve (and show) the entry in row index 3, column index 2 from mat: (Note that row index 3 is the fourth row, of course! You should get back 33.)
[]:
# Entry in 3,2:
Use a slice to find the 34 submatrix containing rows with index 2-4(inclusive) and columns 4-7(inclusive) from mat:
[]:
# rows 2-4 and columns 4-7:
Use a slice to get the last row of the matrix:
[]:
# last row:
Use a slice to get the first column of the matrix:
[]:
# first column:
Random Numbers
Create a random number generator and assign it to the variable rng like we did in the examples. Set the seed to be 4567.
[]:
# Random number generator
Use rng to create and display 10 random floating point numbers uniformly distributed between 5 and 10:
[]:
# 10 numbers from 5 to 10:
Use rng to create and display 10 normally distributed random numbers with mean (location) of 2 and standard deviation (scale) of 3:
[]:

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 Programming Questions!