Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 = ['本月累计','上月同期','去年同期'] 后面缺少逗号,
请作者大大批评指正~