What  is the python code in getting the average purchase amount  Company likes to find out overall average purchase-amount among all transactions [ one transaction indicates one invoice number].  Expected output: Average purchase among all transactions = 44.39

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
Question

What  is the python code in getting the average purchase amount 

Company likes to find out overall average purchase-amount among all transactions [ one transaction indicates one invoice number]. 

Expected output: Average purchase among all transactions = 44.39

In (45):
1 Datal.head (200)
Out[45]:
InvoloeNo stookCode
Desoription Guantity
InvoloeDate UnitPrioe Cuctomerio
Country
536365
85123A
WHITE HANGING HEART T-LIGHT HOLDER
01/12/2010 826
2.55
17850.0 Untad Kingdom
536365
71063
WHITE METAL LANTERN
O1/12/2010 826
3.39
17850.0 United Kingdom
2
53636G
844068
CREAM CUPID HEARTS COAT HANGER
01/12/2010 826
2.75
17850.0 Unted Kingdom
536365
84029G KNITTED UNION FLAG HOT WATER BOTTLE
01/12/2010 8:26
3.39
17850.0 Untad Kingdom
4
536365
84029E
RED WOOLLY HOTTIE WHITE HEART.
01/12/2010 826
3.39
17800.0 United Kingdom
186
536388
22469
HEART OF WICKER SMALL
12 01/12/2010 9.50
1.65
16250.0 Unted Kingdom
188
536388
22242
5 HOCK HANGER MAGIC TOADSTOOL
12 01/12/2010 9.59
1.65
16250.0 Unted Kingdom
187
536389
22941
CHRISTMAS LIGHTS 10 REINDEER
6 01/12/2010 10:03
8.50
12431.0
Australia
188
536389
21622
VINTAGE UNION JACK CUSHION COVER
8 O112/2010 10.03
4.95
12431.0
Australia
188
536389
21701
VINTAGE HEADS AND TAILS CARD GAME
12 01/12/2010 10:03
1.25
12431.0
Australia
200 rows x 8 columns
In (49):
1 Datal.tail(200)
Out[49]:
InvoloeNo atookCode
Decoription Quantity
InvolceDate UnitPrioe Cuctomerio
Country
641700
581667
22625
RED KITCHEN SCALES
2 0812/2011 11.56
8.50
16626.0 Unted Kingdom
641710
581067
23356
HOT WATER BOTTLE KEEP CALM
4 O9122011 11:06
4.95
16626.0 Unted Kingdom
641711
581567
21326 AGED GLASS SILVER T-LIGHT HOLDER
144 09/122011 11.56
0.55
16626.0 Unted Kingdom
641712
581567
21479
WHITE SKULL HOT WATER BOTTLE
4 O9122011 11:56
4.25
16626.0 Unted Kingdom
641713
581567
23356
LOVE HOT WATER BOTTLE
3 Ce122011 11.56
5.95
16626.0 United Kingdom
641B04
581587
22613
PACK OF 20 SPACEBOY NAPKINS
12 D9/122011 12:50
O.85
12680.0
France
641805
581587
22899
CHLDRENS APRON DOLLY GIRL
6 D9/122011 12.50
2.10
12680.0
France
641808
581587
23254
CHILDRENS CUTLERY DOLLY GIRL
4 Da/122011 12.50
4.15
12680.0
France
641807
5815I7
23256 CHILDRENS CUTLERY CIRCUS PARADE
4 D9/122011 12:50
4.15
12680.0
France
641803
581587
22138
BAKING SET 9 PIECE RETROSPOT
3 D/122011 12.50
4.95
12680.0
France
200 rows x 8 columns
Transcribed Image Text:In (45): 1 Datal.head (200) Out[45]: InvoloeNo stookCode Desoription Guantity InvoloeDate UnitPrioe Cuctomerio Country 536365 85123A WHITE HANGING HEART T-LIGHT HOLDER 01/12/2010 826 2.55 17850.0 Untad Kingdom 536365 71063 WHITE METAL LANTERN O1/12/2010 826 3.39 17850.0 United Kingdom 2 53636G 844068 CREAM CUPID HEARTS COAT HANGER 01/12/2010 826 2.75 17850.0 Unted Kingdom 536365 84029G KNITTED UNION FLAG HOT WATER BOTTLE 01/12/2010 8:26 3.39 17850.0 Untad Kingdom 4 536365 84029E RED WOOLLY HOTTIE WHITE HEART. 01/12/2010 826 3.39 17800.0 United Kingdom 186 536388 22469 HEART OF WICKER SMALL 12 01/12/2010 9.50 1.65 16250.0 Unted Kingdom 188 536388 22242 5 HOCK HANGER MAGIC TOADSTOOL 12 01/12/2010 9.59 1.65 16250.0 Unted Kingdom 187 536389 22941 CHRISTMAS LIGHTS 10 REINDEER 6 01/12/2010 10:03 8.50 12431.0 Australia 188 536389 21622 VINTAGE UNION JACK CUSHION COVER 8 O112/2010 10.03 4.95 12431.0 Australia 188 536389 21701 VINTAGE HEADS AND TAILS CARD GAME 12 01/12/2010 10:03 1.25 12431.0 Australia 200 rows x 8 columns In (49): 1 Datal.tail(200) Out[49]: InvoloeNo atookCode Decoription Quantity InvolceDate UnitPrioe Cuctomerio Country 641700 581667 22625 RED KITCHEN SCALES 2 0812/2011 11.56 8.50 16626.0 Unted Kingdom 641710 581067 23356 HOT WATER BOTTLE KEEP CALM 4 O9122011 11:06 4.95 16626.0 Unted Kingdom 641711 581567 21326 AGED GLASS SILVER T-LIGHT HOLDER 144 09/122011 11.56 0.55 16626.0 Unted Kingdom 641712 581567 21479 WHITE SKULL HOT WATER BOTTLE 4 O9122011 11:56 4.25 16626.0 Unted Kingdom 641713 581567 23356 LOVE HOT WATER BOTTLE 3 Ce122011 11.56 5.95 16626.0 United Kingdom 641B04 581587 22613 PACK OF 20 SPACEBOY NAPKINS 12 D9/122011 12:50 O.85 12680.0 France 641805 581587 22899 CHLDRENS APRON DOLLY GIRL 6 D9/122011 12.50 2.10 12680.0 France 641808 581587 23254 CHILDRENS CUTLERY DOLLY GIRL 4 Da/122011 12.50 4.15 12680.0 France 641807 5815I7 23256 CHILDRENS CUTLERY CIRCUS PARADE 4 D9/122011 12:50 4.15 12680.0 France 641803 581587 22138 BAKING SET 9 PIECE RETROSPOT 3 D/122011 12.50 4.95 12680.0 France 200 rows x 8 columns
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Public key encryption
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.
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