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 to not included in steps of :
:
# to less than:
Create and show an array with evenly spaced values from to inclusive:
:
# points from to :
Make and show a twodimensional array of zeros: Dont do it by entering all values manually
:
# x zeros:
Indexing an Array
Run the cell below to define and display a matrix mat:
:
mat nparangereshape
printmat
Use matrix indexing to retrieve and show the entry in row index column index from mat: Note that row index is the fourth row, of course! You should get back
:
# Entry in :
Use a slice to find the submatrix containing rows with index inclusive and columns inclusive from mat:
:
# rows and columns :
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
:
# Random number generator
Use rng to create and display random floating point numbers uniformly distributed between and :
:
# numbers from to :
Use rng to create and display normally distributed random numbers with mean location of and standard deviation scale of :
:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
