This notebook is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
%matplotlib inline
from pathlib import Path
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
Quick Review Question 1
Quick Review Question 2
Use both the floor method and the direct generation of random integers for each exercise below.
Quick Review Question 3
Write a command to generate a 10-by-10 matrix of random integers from 1 through 100, inclusively, that is, from the set {1, 2, 3, ..., 99, 100}. Print out several matrices below to show how it changes each time.
Now seed the random number generator with a four-digit number and print out 4 matrices. Then rerun it (make sure the seed is also rerun!) several times, and notice that the list does not change.
Quick Review Question 4
Assign 10 to the variable r
.
Then, assign to r
the remainder of the division of 7r
by 11
.
Before executing the command, calculate the final value of r
by hand to check your work.
Quick Review Question 5
np.random.uniform
using the parameter size
in the same manner as np.random.uniform
. Store the results in the variable normal_nums
. Do not display normal_nums
!normal_nums
.normal_nums
.
Quick Review Question 6
sine_array
, of 1000 values of the sine of a random floating point number between 0 and π.sine_array
.sine_array
with 10 categories.