-
Notifications
You must be signed in to change notification settings - Fork 7
Relationship between browser and average revenue #59
base: master
Are you sure you want to change the base?
Conversation
jonathancstroud
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add 2 blank lines after here.
jonathancstroud
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for deleting the files. There are still some unresolved comments to address.
No description provided.