Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

## 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

What is focal length? Explain with a diagram and give an example.

Answered: 1 week ago

Question

What is physics and how does it apply in daily life?

Answered: 1 week ago

Question

What is the relation of physical mathematics with examples?

Answered: 1 week ago