Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Demonstrate a basic knowledge of frequency distributions and histograms by writing a python program. write code to create a frequency distribution chart that emulates a
Demonstrate a basic knowledge of frequency distributions and histograms by writing a python program. write code to create a frequency distribution chart that emulates a histogram for a given dataset without access to special libraries.I have provided a base for this program tha should be added to and not altered, this what I have thus far:
#DO NOT MODIFY THE CODE IN THIS FILE
#File: Projpy
#Revised:
Among other things, this project requires you to
demonstrate a basic knowledge of frequency
distributions and histograms. In this project,
you will write code to create a frequency
distribution chart that emulates a histogram for a
given dataset without access to special libraries.
You will not be required to write the code to produce
the chart. You simply need to write the code to
produce the data that will be used by the following
code to produce the chart.
from ProjRunner import Runner
import sys
import textwrap
print
Expected three numeric commandline arguments."
#Get the commandline arguments and put them in a
#list named args.
args listmapint sysargv:
# Check if the user has entered three commandline arguments
if lenargs:
printMissing commandline arguments"
printUse default values in place of commandline arguments"
args
printThe default values are:args
else:
printThe commandline arguments are:", args
#Use the commandline arguments to create a dataset.
datalist
rangelist
rangelist
rangelist
rangelist
rangelist
rangelist
rangeintargsintargsintargs
printThe dataset is:
wrappedlist textwrap.wrapstrdata width
for line in wrappedlist:
printline
print
Your code may not import anything.
printExecute student code."
#Call student's run function to process the dataset
#and return the result.
result Runner.rundata
print
Display data returned by student code."
#Use the list returned from student's run function to
#display a frequency distribution chart.
#Find the maximum value in the result
maxvalue maxresult
# Loop through each row
for i in rangemaxvalue, :
# Loop through each value in the result
for j in rangelenresult:
if resultj i:
print x end
else:
print end
print
# Print the xaxis labels
for i in rangelenresult:
print end
print
#Print the list returned by the student's run function.
printresult
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started