import pandas as pd import matplotlib.pyplot as plt # store the data in a pandas series (column in a dataframe) data = pd.Series([1,2,3,4,5,6]) # compute and print the mean, median, and variance of the data print("The mean is",data.mean()) print("The median is",data.median()) print("The variance is",data.var()) # find and print the largest number in the data maxNum = data.max() print("The biggest value is",maxNum) # find and print the smallest number in the data minNum = data.min() print("The smallest value is",minNum) # plot the numbers in a histogram that has one bin for each possible number # bins = range(2,8) tells the program to create bins with boundaries 2,3,4,5,6,7 # These boundaries start at the first number in the range() command, and go up by # 1 until they are 1 less than the last number. data.plot.hist(bins = range(minNum,maxNum+2), title="Histogram of data") plt.show() # Uncomment for Part B by removing the ''' (make a commment over mutiple lines) ''' # print basic statistics about the data (number of numbers in the dataset, # mean, standard deviation (square root of variance), min, 25% percentile, # 50% percentile or median, 75% percentile, max) print(data.describe()) # make a boxplot of the data data.plot.box(title="Boxplot of data") # to include the mean: data.plot.box(showmeans=True,title="Boxplot of data") plt.show() '''