Skip to content

勘误表.md #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

勘误表.md #6

wants to merge 3 commits into from

Conversation

Hoantrbl
Copy link
Contributor

@Hoantrbl Hoantrbl commented Mar 8, 2019

P238 Q1&Q2

Q1:
原代码:
def get_month_data(data):
sale = (data['Price']*data['Qty']).sum()
traffic = data['sheetID'].drop_duplicates().count()
s_t = sale/traffic
return (sale,traffic,price)

sale_1,traffic_1,s_t_1 = get_month_data(This_data)
sale_2,traffic_2,s_t_2 = get_month_data(last_data)
sale_3,traffic_3,s_t_3 = get_month_data(same_data)

会出现 This data 无法定义的问题的,

后将This_data改为This_month,下同

出现KeyError:Price

标签无法定义问题,后怀疑是变量过多且定义不明确,进行修改。

Q2:columns = ['本月累计','上月同期','去年同期'] 后面缺少逗号,

请作者大大批评指正~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant