Relationship between browser and average revenue#59
Relationship between browser and average revenue#59Tonyzhou98 wants to merge 7 commits intomasterfrom
Conversation
jonathancstroud
left a comment
There was a problem hiding this comment.
Looks good! Thanks for the PR. Please remove the extraneous files, which includes everything other than explore.py and explore_utils.py. If you know how to do so, I recommend deleting these from git history so that they do not get added to our repo permanently. Otherwise, there are some minor comments posted for you to address. Thanks!
| returns: | ||
| the name of each browser, and the average of revenue by each browser | ||
| """ | ||
| train_df = dataset.train |
There was a problem hiding this comment.
Please do a shallow copy when you access the data. Otherwise, the line below will add "revenue" to the dataframe object and it could affect other code.
| train_df = dataset.train | ||
| train_df['revenue'] = train_df['totals.transactionRevenue'].astype(float).fillna(0) | ||
| grouped_customer = train_df.groupby('device.browser')['revenue'].mean()/10000 | ||
| grouped_browser = train_df.groupby('device.browser')['device.browser'].unique() |
There was a problem hiding this comment.
(Optional) consider sorting by average revenue for more consistent results.
|
|
||
| diff_browser, average_for_device = explore_utils.find_device_revenue_relationship(data) | ||
| for i,j in zip(diff_browser, average_for_device): | ||
| print("The average revenue for %s is %.2f" %(i,j)) |
There was a problem hiding this comment.
Please add 2 blank lines after here.
jonathancstroud
left a comment
There was a problem hiding this comment.
Thanks for deleting the files. There are still some unresolved comments to address.
No description provided.