#-*-coding:utf-8-*-#analysis of food and beverage sales data statistics from __future__ Importprint_functionImportPandas as Pdcatering_sale='.. /data/catering_sale.xls' #Dining Datadata = Pd.read_excel (Catering_sale, Index_col = u'Date')#reading data, specifying "date" as index columndata = data[(data[u'Sales'] > & (data[u'Sales'] < 5000)]#Filter Exception DataStatistics = Data.describe ()#Save Basic Statisticsstatistics.loc['Range'] = statistics.loc['Max']-statistics.loc['min']#very poorstatistics.loc['var'] = statistics.loc['STD']/statistics.loc['mean']#coefficient of variationstatistics.loc['Dis'] = statistics.loc['75%']-statistics.loc['25%']#four spacing between digitsPrint(statistics) D:\Download\python3\python3.exe"e:/a is learning/python data dig/chapter3/demo/code/3-2_statistics_analyze.py"Sales Count195.000000mean2744.595385STD424.739407min865.00000025% 2460.6000005% 2655.90000075% 3023.200000Max4065.200000Range3200.200000var0.154755Dis562.600000Process finished with exit code 0
Python Data Statistics analysis