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

Step: 3

blur-text-image

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

Database And Expert Systems Applications 22nd International Conference Dexa 2011 Toulouse France August/September 2011 Proceedings Part 1 Lncs 6860

Authors: Abdelkader Hameurlain ,Stephen W. Liddle ,Klaus-Dieter Schewe ,Xiaofang Zhou

2011th Edition

3642230873, 978-3642230875

More Books

Students also viewed these Databases questions

Question

How will passive and active capital structure changes differ?

Answered: 1 week ago

Question

4. Explain the strengths and weaknesses of each approach.

Answered: 1 week ago