不同菜品在某段时间的销售量的分布情况

import pandas as pd
import matplotlib.pyplot as plt
catering_dish_profit = 'D:/Python数据分析与挖掘实战/课件/《Python数据分析与挖掘实战(第2版)》源数据和代码/Python数据分析与挖掘实战(第2版)/chapter3/demo/data/catering_dish_profit.xls'  # 餐饮数据
data = pd.read_excel(catering_dish_profit)  # 读取数据,指定“日期”列为索引

# 绘制饼图
x = data['盈利']
labels = data['菜品名']
plt.figure(figsize = (8, 6))  # 设置画布大小
plt.pie(x,labels=labels)  # 绘制饼图
plt.rcParams['font.sans-serif'] = 'SimHei'
plt.title('菜品销售量分布(饼图)')  # 设置标题
plt.axis('equal')
plt.show()

# 绘制柱形图
x = data['菜品名']
y = data['盈利']
plt.figure(figsize = (8, 4))  # 设置画布大小
plt.bar(x,y)
plt.rcParams['font.sans-serif'] = 'SimHei'
plt.xlabel('菜品')  # 设置x轴标题
plt.ylabel('销量')  # 设置y轴标题
plt.title('菜品销售量分布(条形图)')  # 设置标题
plt.show()  # 展示图片

 

  • 1
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
分享产生价值! A valuable new edition of a standard reference "A 'must-have' book for anyone expecting to do research and/or applications in categorical data analysis." –Statistics in Medicine on Categorical Data Analysis, First Edition The use of statistical methods for categorical data has increased dramatically, particularly for applications in the biomedical and social sciences. Responding to new developments in the field as well as to the needs of a new generation of professionals and students, this new edition of the classic Categorical Data Analysis offers a comprehensive introduction to the most important methods for categorical data analysis. Designed for statisticians and biostatisticians as well as scientists and graduate students practicing statistics, Categorical Data Analysis, Second Edition summarizes the latest methods for univariate and correlated multivariate categorical responses. Readers will find a unified generalized linear models approach that connects logistic regression and Poisson and negative binomial regression for discrete data with normal regression for continuous data. Adding to the value in the new edition is coverage of: Three new chapters on methods for repeated measurement and other forms of clustered categorical data, including marginal models and associated generalized estimating equations (GEE) methods, and mixed models with random effects Stronger emphasis on logistic regression modeling of binary and multicategory data An appendix showing the use of SAS for conducting nearly all analyses in the book Prescriptions for how ordinal variables should be treated differently than nominal variables Discussion of exact small-sample procedures More than 100 analyses of real data sets to illustrate application of the methods, and more than 600 exercises An Instructor's Manual presenting detailed solutions to all the problems in the book is available from the Wiley editorial department.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值