Skip to content

勘误表.md#6

Open
Hoantrbl wants to merge 3 commits intojunhongzhang:masterfrom
Hoantrbl:mybranch
Open

勘误表.md#6
Hoantrbl wants to merge 3 commits intojunhongzhang:masterfrom
Hoantrbl:mybranch

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 = ['本月累计','上月同期','去年同期'] 后面缺少逗号,

请作者大大批评指正~

Hoantrbl added 3 commits March 8, 2019 09:36
Signed-off-by: PungTeng <48271804+PungTeng@users.noreply.github.com>
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