#May 1, 2023. #Python 3 code to find mean and median and draw a histogram. import matplotlib.pyplot as plt data1 = [672, 639, 645 ,611, 618 ,624, 601, 598, 636, 599 , 606, 583, 592, 592, 577, 573 ,593, 569 ,564, 566 ,576] mean = sum(data1)/21 print("The mean is ", mean, end = ".\n\n") data2 = sorted (data1) print("The sorted data is ", data2, end = ".\n\n") median = data2[11] print("The median is ", median, end = ".\n\n") plt.hist(data1, color = 'blue', edgecolor = 'black', bins = 6) plt.xlabel('Mills Win-Loss Percentage') plt.show() #The mode is the bin with the highest bar, the most items in the bin. """ (1) Pick your own set of 21 baseball players from Mr. Sagarin's website at http://sagarin.com/mills/seasons.htm . Or, find some data on your own-- 21 values of something like city populations, crimes rates, ages, etc. (2) Find the mean and the median. (3) Use Python to draw a histogram and say which numbers, roughly, have the highest bars. You can choose the number of bins to be anything from 6 to 20. """ ######################################################################