Task-6: Company also likes to find out the total purchase amount and the number transactions made by each customer in their lifetime Create new data frame called "new-dataset", containing the columi ['CustomerlID', 'TotalPurchaseAmount', 'NumberofTransactions']. Display the la 10 rows. Expected output is as follows: CustomerID TotalPurchaseAmount NumberOrTransactions 15100 350 40 7 15291 328.80 2 15311 454.63 36 16029 3702.12 8 10 16098 430.60 12 11 16250 226.14 14 12 17420 130.85 13 17809 34.80 1 14 17850 725.44 45 15 18074 489.60 13

Np Ms Office 365/Excel 2016 I Ntermed
1st Edition
ISBN:9781337508841
Author:Carey
Publisher:Carey
Chapter5: Working With Excel Tables, Pivottables, And Pivotcharts
Section: Chapter Questions
Problem 3.10CP
icon
Related questions
icon
Concept explainers
Question

What is the python code for this 

Task-6:
Company also likes to find out the total purchase amount and the number of
transactions made by each customer in their lifetime
Create new data frame called "new-dataset", containing the columns
['CustomerID', 'TotalPurchaseAmount', 'NumberofTransactions']. Display the last
10 rows. Expected output is as follows:
CustomerID TotalPurchaseAmount NumberOfTransactions
15100
350 40
7
15291
328.80
2
15311
454.63
36
16029
3702.12
8
10
16098
430.60
12
11
16250
226.14
14
12
17420
130.85
13
17809
34.80
14
17850
725.44
45
15
18074
489.60
13
Transcribed Image Text:Task-6: Company also likes to find out the total purchase amount and the number of transactions made by each customer in their lifetime Create new data frame called "new-dataset", containing the columns ['CustomerID', 'TotalPurchaseAmount', 'NumberofTransactions']. Display the last 10 rows. Expected output is as follows: CustomerID TotalPurchaseAmount NumberOfTransactions 15100 350 40 7 15291 328.80 2 15311 454.63 36 16029 3702.12 8 10 16098 430.60 12 11 16250 226.14 14 12 17420 130.85 13 17809 34.80 14 17850 725.44 45 15 18074 489.60 13
In [39]:
1 Data1.head(200)
Out[39]:
InvoiceNo StockCode
Description Quantity
InvoiceDate UnitPrice CustomerID
Country
6 01/12/2010 8:26
17850.0 United Kingdom
536365
85123A
WHITE HANGING HEART T-LIGHT HOLDER
2.55
1
536365
71053
WHITE METAL LANTERN
01/12/2010 8:26
3.39
17850.0 United Kingdom
2
536365
84406B
CREAM CUPID HEARTS COAT HANGER
8.
01/12/2010 8:26
2.75
17850.0 United Kingdom
3
536365
84029G KNITTED UNION FLAG HOT WATER BOTTLE
01/12/2010 8:26
3.39
17850.0 United Kingdom
4
536365
84029E
RED WOOLLY HOTTIE WHITE HEART.
01/12/2010 8:26
3.39
17850.0 United Kingdom
...
195
536388
22469
HEART OF WICKER SMALL
12
01/12/2010 9:59
1.65
16250.0 United Kingdom
196
536388
22242
5 HOOK HANGER MAGIC TOADSTOOL
12
01/12/2010 9:59
1.65
16250.0 United Kingdom
197
536389
22941
CHRISTMAS LIGHTS 10 REINDEER
6 01/12/2010 10:03
8.50
12431.0
Australia
198
536389
21622
VINTAGE UNION JACK CUSHION COVER
8 01/12/2010 10:03
4.95
12431.0
Australia
199
536389
21791
VINTAGE HEADS AND TAILS CARD GAME
12 01/12/2010 10:03
1.25
12431.0
Australia
Activate Windov
Transcribed Image Text:In [39]: 1 Data1.head(200) Out[39]: InvoiceNo StockCode Description Quantity InvoiceDate UnitPrice CustomerID Country 6 01/12/2010 8:26 17850.0 United Kingdom 536365 85123A WHITE HANGING HEART T-LIGHT HOLDER 2.55 1 536365 71053 WHITE METAL LANTERN 01/12/2010 8:26 3.39 17850.0 United Kingdom 2 536365 84406B CREAM CUPID HEARTS COAT HANGER 8. 01/12/2010 8:26 2.75 17850.0 United Kingdom 3 536365 84029G KNITTED UNION FLAG HOT WATER BOTTLE 01/12/2010 8:26 3.39 17850.0 United Kingdom 4 536365 84029E RED WOOLLY HOTTIE WHITE HEART. 01/12/2010 8:26 3.39 17850.0 United Kingdom ... 195 536388 22469 HEART OF WICKER SMALL 12 01/12/2010 9:59 1.65 16250.0 United Kingdom 196 536388 22242 5 HOOK HANGER MAGIC TOADSTOOL 12 01/12/2010 9:59 1.65 16250.0 United Kingdom 197 536389 22941 CHRISTMAS LIGHTS 10 REINDEER 6 01/12/2010 10:03 8.50 12431.0 Australia 198 536389 21622 VINTAGE UNION JACK CUSHION COVER 8 01/12/2010 10:03 4.95 12431.0 Australia 199 536389 21791 VINTAGE HEADS AND TAILS CARD GAME 12 01/12/2010 10:03 1.25 12431.0 Australia Activate Windov
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Query Syntax
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
Oracle 12c: SQL
Oracle 12c: SQL
Computer Science
ISBN:
9781305251038
Author:
Joan Casteel
Publisher:
Cengage Learning
A Guide to SQL
A Guide to SQL
Computer Science
ISBN:
9781111527273
Author:
Philip J. Pratt
Publisher:
Course Technology Ptr