Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I'm having a hard time with this code I am also writing in python now with this I dont know what is wrong and why

I'm having a hard time with this code

image text in transcribed

I am also writing in python

image text in transcribed

now with this I dont know what is wrong and why it's not running properly

kpoint Last Monday at 12:21 PM (unsaved changes) File Edit View Insert Cell Kernel Widgets Help Logout + Run >> wata TITTC Raw NBConvert Trusted Python 3 O In [12]: #Write your code here import pandas as pd roll_dict = [] num_exp = 10000 for i in np.arange(num_exp): rolls = np.random.choice(die, 2) outcome = np.sum(rolls) if outcome in roll_dict.keys(): roll_dict(outcome] += 1 else: roll_dict[outcome] = 1 roll_df = pd. DataFrame(list(roll_dict.items()), columns = ['outcome','frequency']) roll_df.head() Out[12]: outcome frequency 0 5 1 In [14]: #Write your code here Question 4: Plot a histogram using DataFrame function (hist() to display the distribution of the value per move in Monopoly using default bins. In [1]: #Write your code here roll_df [['rolls']] hist NameError Traceback (most recent call last) in 1 #Write your code here ----> 2 roll_df[['rolls']] histo) NameError: name 'roll_df' is not defined **Question 5:** Plot default bins. 1 histogram using Matplotlib library to display the distribution of the value per move in Monopoly using In [16] : #Write your code here Question 6: Choose a custom bins range so that it displays best the frequency of each move value in 10,eee experiments. hint usings range with floating numbers 819 PM 3/11/2221 a O Type here to search

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