Python Data Statistics analysis

Source: Internet
Author: User

#-*-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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.