Question: Part 1 : Using Numpy and Pandas to create a DataFrame The dataset should contain 5 columns for 1 0 ( rows ) randomly generated

Part 1: Using Numpy and Pandas to create a DataFrame
The dataset should contain 5 columns for 10(rows) randomly generated pairs of dice rolls:
Column 1-Dice Pair: Consists of tuples containing a pair of numbers when two dice numbered 1-6
Column 2-Sum
Column 3-Product
Column 4-Max
Column 5-Min
How can we create the dataframe:
Define the number of dice rolls (in other words number of rows) you want to generate by setting the value of n. Use NumPy's randint function (np.random.randint()) to generate an array of n rows and 2 columns representing two dice rolls. The values generated will be between 1 and 6(inclusive)
Then, create a Python dictionary that contains the key-value pairs for each column you want to create in the DataFrame. Ex: data Dice_roll : , Sum : ,Product: ,.....
 Part 1: Using Numpy and Pandas to create a DataFrame The

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!