python資料統計量分析

來源:互聯網
上載者:User

標籤:chapter   utf-8   指定   xls   das   range   read   down   load   

#-*- coding: utf-8 -*-#餐飲銷量資料統計量分析from __future__ import print_functionimport pandas as pdcatering_sale = ‘../data/catering_sale.xls‘ #餐飲資料data = pd.read_excel(catering_sale, index_col = u‘日期‘) #讀取資料,指定“日期”列為索引列data = data[(data[u‘銷量‘] > 400)&(data[u‘銷量‘] < 5000)] #過濾異常資料statistics = data.describe() #儲存基本統計量statistics.loc[‘range‘] = statistics.loc[‘max‘]-statistics.loc[‘min‘] #極差statistics.loc[‘var‘] = statistics.loc[‘std‘]/statistics.loc[‘mean‘] #變異係數statistics.loc[‘dis‘] = statistics.loc[‘75%‘]-statistics.loc[‘25%‘] #四分位元間距print(statistics)D:\Download\python3\python3.exe "E:/A正在學習/python data dig/chapter3/demo/code/3-2_statistics_analyze.py"                銷量count   195.000000mean   2744.595385std     424.739407min     865.00000025%    2460.60000050%    2655.90000075%    3023.200000max    4065.200000range  3200.200000var       0.154755dis     562.600000Process finished with exit code 0

 

python資料統計量分析

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.