首页
网站开发
桌面应用
管理软件
微信开发
App开发
嵌入式软件
工具软件
数据采集与分析
其他
首页
>
> 详细
代做program、Java/python编程代写
项目预算:
开发周期:
发布时间:
要求地区:
Assignment 1, Commerce 3DA3 C02 - Predictive Data Analytics
To complete this assignment, please create a Jupyter notebook. The code in your jupyter notebook should provide answers to questions asked in the assignment. Please submit the assignment by uploading the file(s) into the "Assignment 1" folder on Avenue to Learn. You can find this folder under "Assessments>Assignments" on the course page. The deadline for submission is 11:59PM on Monday Oct. 21.
Background
In the past decade, we witnessed the rise of online grocery shopping. With the convenience of ordering groceries from the comfort of home, more people are turning to digital platforms for their everyday needs. This shift has been further fueled by factors such as busy lifestyles, the increasing use of mobile devices, and the covid-19 pandemic, which underscored the importance of contactless shopping.
For online grocery platforms, conducting data analysis on sales records is critical for understanding customer behavior, enhancing the overall shopping experience, and make data-driven decisions that lead to higher customer satisfaction and profitability.
Data: We will make use of two datasets from the transaction records of an online grocery delivery platform, stored in the files orders.csv (click to download) and order_products.csv (click to download).
The dataset in orders.csv includes the following columns:
order_id: This is the unique identifier of every customer order
customer_id: This is the unique identifier of every customer who placed the order order_dow: This indicates the day of the week, on which the order took place. 0 stands for Sunday, 1-5 indiates Monday-Friday, and 6 indicates a Saturday. order_hour_of_day: This indicates during which hour the order took place; for example, 14 indicates that the order was placed between 14:00 and 14:59. days_since_prior_order: This indicates how many days have passed since the customer's last order
coupon_use: This shows if the customer used a coupon to (partially) pay for the order
The dataset in order_products.csv records which products are purchased in an order. It
includes the following columns:
order_id: This is the order idenfitier (same as in order.csv).
product_id: This is the identifier of a product that is purchased in the corresponding order.
quantity: This is the quantity of the product purchased in the corresponding order. unit_price: This is the unit price (in dollars) of the product purchased in the corresponding order.
customer_id: This is the identifier of the customer who purchased the product.
Please note that order_id in order_products.csv does not need to be unique. If two rows in order_products.csv share the same order_id, it means that in the same order, the products in those two rows are both purchased.
For example, suppose that the following row exists in order.csv:
order_id customer_id order_dow order_hour_of_day days_since_prior_order coupon_u
O1234 C6217 2 10 11 yes and the following two rows exist in order_products.csv:
order_id
O1234
O1234
product_id quantity
P0217 1
P0219 2
unit price customer_id
9.99 C6217
19.99 C6217
then we know that in the same order (order_id O1234), 1 unit of product P0217 and 2 units of product P0219 are purchased. And this order O1234 is the same order as the order O1234 in order.csv.
Imagine that you are a data analyst at the grocery delivery platform. Based on the datasets, please answer the following questions/tasks.
Questions 0.
In the first cell of your Jupyter notebook, please create the following as markdown. Add your first and last name, and your Student ID.
se
Important: For the remaining questions, please make sure to create a markdown cell before you answer each question and in it indicate the question number, e.g., Question 1, Question 2, etc.
For each question, you should use one or more code cells to present your codes. Please make sure that you run each cell and display all the requested results. Please also ensure that you will use markdown cells to provide necessary explanations of your codes and results.
The Jupyter notebook should be a easy-to-read report that presents your analysis and results. The grading will be based on both the correctness of your coding and the readability of your notebook.
Question 1.
Import the two .csv files and assign them to a dataframe called df_orders and df_order_products , respectively. Then,
use a line of codes to review the first few rows of the dataframes. The result should be clearly displayed in the notebook after you run the code cells.
get the structures of the dataframes (number of rows, column types, etc.) using the
info() function. Review the first few rows of the dataframe.
In a markdown cell,explain the results returned by this function as comprehensive as you
can..
Question 2.
For the DataFrame df_orders loaded from orders.csv, perform the following steps in the given order.
1. Find how many missing value each column contains.
2. For any missing value in the column , replace it with 'unknown_order'
3. For any missing value in the column , replace it with
'unknown_customer'
order_id
customer_id
4. For any missing value in the column , replace it with the mean value of the column
5. After completing the above steps, repeat the codes in Step 1 to check again the number of missing values in each column
6. For any remaining missing values, drop all rows containing a missing value
Question 3.
The grocery delivery platform is interested in assessing if offering coupons will increase customers' purchase frequency. To that end, let us again make use of the DataFrame
df_orders (loaded from orders.csv) to perform the following tasks.
1. Select all rows in df_orders where use of a coupon is yes , and assign those rows as a new DataFrame named df_orders_coupon .
2. Calculate the mean value of 'days_since_prior_order' in df_orders_coupon .
3. Select all rows in where use of a coupon is no , and assign those rows
as a new DataFrame named .
4. Calculate the mean value of 'days_since_prior_order' in df_orders_no_coupon .
Based on your findings of the above steps, answer the following question in a markdown cell:
Is the use of coupon associated with higher/lower order frequency? Please briefly explain your answer in the markdown cell.
Questions 4.
The platform is also interested in measuring the total number of orders received on each day of the week. To do this, they would like you to complete the following tasks.
Divide the order id's in the 'order_id' column of the DataFrame df_orders (loaded from orders.csv) into groups, based on the day of the week ('order_dow') when the order is placed. The result should be a Groupby object.
Construct and display the content of a pandas Series, which should show the total number of orders for each day of the week.
Question 5.
As observed, each row of the data in order_products.csv is the sales information of a product in a certain order. The information includes the per-unit price and number of units ordered, but it does not directly provide the revenue.
df_orders
df_orders_no_coupon
days_since_prior_order
Let us now create a new column named 'revenue' in the DataFrame df_order_products constructed from order_products.csv. For each row, the
column should contain the corresponding revenue, calcuated as 'quantity'×'unit price'. See the following two-row example for a demonstration.
order_id product_id quantity unit_price customer_id revenue
O1234 P0217 1 9.99 C6217 9.99
O1234 P0219 2 19.99 C6217 39.98
After you have added the new column, further complete the following tasks:
Display the first few rows of the updated df_order_products DataFrame. Calculate the total revenue by summing up revenues in each row.
Question 6
From time to time, there will be customers who would like to review their purchase record. To do that, they will need to supply their customer id.
Suppose a customer with the id '0421MWMT' just contacted Customer Service and would like to see all their purchases. Perform the following tasks for the customer.
Select all rows related to this customer's purchases in the DataFrame df_order_products (loaded from order_products.csv), and assign them to a
new DataFrame named 'df_cust_inquiry'. Display the content of this DataFrame. Calculate the customer's total purchase in dollar amount.
软件开发、广告设计客服
QQ:99515681
邮箱:99515681@qq.com
工作时间:8:00-23:00
微信:codinghelp
热点项目
更多
代写dts207tc、sql编程语言代做
2024-12-25
cs209a代做、java程序设计代写
2024-12-25
cs305程序代做、代写python程序...
2024-12-25
代写csc1001、代做python设计程...
2024-12-24
代写practice test preparatio...
2024-12-24
代写bre2031 – environmental...
2024-12-24
代写ece5550: applied kalman ...
2024-12-24
代做conmgnt 7049 – measurem...
2024-12-24
代写ece3700j introduction to...
2024-12-24
代做adad9311 designing the e...
2024-12-24
代做comp5618 - applied cyber...
2024-12-24
代做ece5550: applied kalman ...
2024-12-24
代做cp1402 assignment - netw...
2024-12-24
热点标签
mktg2509
csci 2600
38170
lng302
csse3010
phas3226
77938
arch1162
engn4536/engn6536
acx5903
comp151101
phl245
cse12
comp9312
stat3016/6016
phas0038
comp2140
6qqmb312
xjco3011
rest0005
ematm0051
5qqmn219
lubs5062m
eee8155
cege0100
eap033
artd1109
mat246
etc3430
ecmm462
mis102
inft6800
ddes9903
comp6521
comp9517
comp3331/9331
comp4337
comp6008
comp9414
bu.231.790.81
man00150m
csb352h
math1041
eengm4100
isys1002
08
6057cem
mktg3504
mthm036
mtrx1701
mth3241
eeee3086
cmp-7038b
cmp-7000a
ints4010
econ2151
infs5710
fins5516
fin3309
fins5510
gsoe9340
math2007
math2036
soee5010
mark3088
infs3605
elec9714
comp2271
ma214
comp2211
infs3604
600426
sit254
acct3091
bbt405
msin0116
com107/com113
mark5826
sit120
comp9021
eco2101
eeen40700
cs253
ece3114
ecmm447
chns3000
math377
itd102
comp9444
comp(2041|9044)
econ0060
econ7230
mgt001371
ecs-323
cs6250
mgdi60012
mdia2012
comm221001
comm5000
ma1008
engl642
econ241
com333
math367
mis201
nbs-7041x
meek16104
econ2003
comm1190
mbas902
comp-1027
dpst1091
comp7315
eppd1033
m06
ee3025
msci231
bb113/bbs1063
fc709
comp3425
comp9417
econ42915
cb9101
math1102e
chme0017
fc307
mkt60104
5522usst
litr1-uc6201.200
ee1102
cosc2803
math39512
omp9727
int2067/int5051
bsb151
mgt253
fc021
babs2202
mis2002s
phya21
18-213
cege0012
mdia1002
math38032
mech5125
07
cisc102
mgx3110
cs240
11175
fin3020s
eco3420
ictten622
comp9727
cpt111
de114102d
mgm320h5s
bafi1019
math21112
efim20036
mn-3503
fins5568
110.807
bcpm000028
info6030
bma0092
bcpm0054
math20212
ce335
cs365
cenv6141
ftec5580
math2010
ec3450
comm1170
ecmt1010
csci-ua.0480-003
econ12-200
ib3960
ectb60h3f
cs247—assignment
tk3163
ics3u
ib3j80
comp20008
comp9334
eppd1063
acct2343
cct109
isys1055/3412
math350-real
math2014
eec180
stat141b
econ2101
msinm014/msing014/msing014b
fit2004
comp643
bu1002
cm2030
联系我们
- QQ: 9951568
© 2021
www.rj363.com
软件定制开发网!