Question: ## Import Numpy and check version import numpy as np print ( f Numpy version is { np . _ _ version _ _

## Import Numpy and check version
import numpy as np
print(f"Numpy version is {np.__version__}")
Numpy version is 1.18.1
Random numbers are frequently used in Data Science.
Generating random numbers (or rather pseudo-random numbers) is an important function.
Numpy provides a random number module called numpy.random.
Create a random number generator called my_rng using the default_rng() method in np.random. Use the default seed.
[]:
# Write your code below.
Now use my_rng to generate a 3X3 numpy array of random values.
Print out this array
[]:
# Write your code below.
[]:
Use the Numpy array created above to create a second Numpy array of random numbers that is between -10.0 and 10.0.
This question requires you to figure out the mapping that will convert a set of random numbers that are distributed as found in the previous question to have the range from -10.0 to 10.0.
The form of the distributon does not change.
[3]:
# Show your code below.
np.random can also generate random integers. Generate a 3X3 array of random integers between 0 and 10.
[]:
# Your code here.
np.random can also generate various common distributions. Generate a 3X3 array of numbers from a normal distribution with mean 10 and standard deviation 2.
[]:
# Your code here
Call the 3X3 matrix of normal random variables generated in the last step gm3.
Use Numpy methods to create two other numpy arrays, row_sum and col_sum:
row_sum should be the length 3 array of the sum of the rows of gm3.
col_sum should be the length 3 array of the sum of the columns of gm3

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!