Question
My output is opposite of correct one. Please help me with this problem in Python 3 please Bottom part is my code from pandas import
My output is opposite of correct one. Please help me with this problem in Python 3 please
Bottom part is my code
from pandas import Series, DataFrame import random as rn import pandas as pd import numpy as np import statistics as st import matplotlib.pyplot as plt
def summaryStatistics(listOfNums): maxVal = np.max(listOfNums) minVal = np.min(listOfNums) meanVal = st.mean(listOfNums) std = st.stdev(listOfNums) median = st.median(listOfNums) perc75 = np.percentile(listOfNums,75) perc25 = np.percentile(listOfNums,25) return [maxVal, minVal, meanVal, std, median, perc75, perc25]
def graphData(xList, yList, zList):
data = {'data1': xList,'data2':yList,'data3':zList}
df = DataFrame(data, columns = ['data1', 'data2', 'data3'], index = ['max', 'min', 'mean', 'stdev', 'median', 'perc75', 'perc25'])
ax = df.plot(xticks = range(7), legend = True, style = ['r+','rx','bx', 'c^', 'g*', 'b' ] ,title = 'Summary Statistics') ax.legend(bbox_to_anchor=(1, 1), loc=2) ax.set_xlabel('Data Set') ax.set_ylabel('Values') x = [rn.randint(0,100) for i in range(100)] y = [rn.randint(0,100) for i in range(100)] z = [rn.randint(0,100) for i in range(100)]
list1 = summaryStatistics(x) list2 = summaryStatistics(y) list3 = summaryStatistics(z)
graphData(list1, list2, list3)?
and my output is
(30 pts) Generate three sets of data (at least 100 values in each dataset) using the HW1 part (b), plot the summary statistics in one figure from all three datasets. Try to reproduce all the details of the example figure (see below). You will need to experiment with parameters of plot such as xticks, legend, style as well as setxlabel() and set ylabel(). Use the following to move the legend to outside of the plot. (Note: import matplotlib.pyplot as plt) 2. plt.legend(bbox_to_anchor (1,1), loc 2) Summary Statistics 100+ ++ max x mean 80 Astdev y median perc25 perc75 60 40 20 data 2 Data Set data 1 data 3 (30 pts) Generate three sets of data (at least 100 values in each dataset) using the HW1 part (b), plot the summary statistics in one figure from all three datasets. Try to reproduce all the details of the example figure (see below). You will need to experiment with parameters of plot such as xticks, legend, style as well as setxlabel() and set ylabel(). Use the following to move the legend to outside of the plot. (Note: import matplotlib.pyplot as plt) 2. plt.legend(bbox_to_anchor (1,1), loc 2) Summary Statistics 100+ ++ max x mean 80 Astdev y median perc25 perc75 60 40 20 data 2 Data Set data 1 data 3
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