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

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education