3 Ib-james Q- Search Sheet Home Insert Page Layout Formulas Data Review View Insert. Calibri (Body) 12 A A- 5 Wrap Text General EX Delete BIU E $ - % ) .0 00 0 Conditional Format Formatting as Table Paste Merge & Center Cell Styles Format A1 v fx Season, Age,Tm,Lg,Pos,G,GS,MP,FG,FGA,FG%,3P,3PA,3P%,2P,2PA,2P%,eFG%,FT,FTA,FT%,ORB, DRB,TRB,AST,STL,BLK,TOV,PF,PTS A B F G H M P 1 Season Age, Im, Lg Pos,G,GS,MP,FG,FGA,FG%,3P,3PA,3P%,2P,2PA,2P%,eFG%,FT,FTA,FT%,ORB,DRB,TRB,AST,STL,BLK,TOV,PF,PTS 2 2003-04,19,CLE NBA SG,79,79,39.5,7.9,18.9,417,0.8,2.7, 290,7.1,16.1,438,438,4.4,5.8,754,1.3,4.2,5.5,5.9,1.6,0.7,3.5,1.9,20.9 3 2004-05,20,CLE,NBA,SF,80,80,42.4,9.9,21.1,472,1.4,3.9,.351,8.6,17.2,499,504,6.0,8.0,.750,1.4,6.0,7.4,7.2,2.2,0.7,3.3,1.8,27.2 4 2005-06,21,CLE,NBA,SF,79,79,42.5,11.1,23.1,480,1.6,4.8,335,9.5,18.3,518,515,7.6,10.3,738,0.9,6.1,7.0,6.6,1.6,0.8,3.3,2.3,31.4 5 2006-07,22,CLE,NBA,SF,78,78,40.9,9.9,20.8,476,1.3,4.0,.319,8.6,16.8,513,507,6.3,9.0,.698,1.1,5.7,6.7,6.0,1.6,0.7,3.2,2.2,27.3 6 2007-08,23,CLE,NBA, SF,75,74,40.4,10.6,21.9,.484,1.5,4.8,315,9.1,17.1,.531,518,7.3,10.3,.712,1.8,6.1,7.9,7.2,1.8,1.1,3.4,2.2,30.0 7 2008-09,24,CLE,NBA,SF,81,81,37.7,9.7,19.9,489,1.6,4.7,344,8.1,15.2,535,530,7.3,9.4,.780,1.3,6.3,7.6,7.2,1.7,1.1,3.0,1.7,28.4 8 2009-10,25,CLE,NBA,SF,76,76,39.0,10.1,20.1,.503,1.7,5.1,333,8.4,15.0,.560,545,7.8,10.2,.767,0.9,6.4,7.3,8.6,1.6,1.0,3.4,1.6,29.7 9 2010-11,26,MIA, NBA, SF,79,79,38.8,9.6,18.8,510,1.2,3.5,330,8.4,15.3,.552,.541,6.4,8.4,.759,1.0,6.5,7.5,7.0,1.6,0.6,3.6,2.1,26.7 10 2011-12,27,MIA, NBA,SF,62,62,37.5,10.0,18.9,531,0.9,2.4,.362,9.1,16.5,556,554,6.2,8.1,.771,1.5,6.4,7.9,6.2,1.9,0.8,3.4,1.5,27.1 11 2012-13,28,MIA, NBA, PF,76,76,37.9,10.1,17.8,565,1.4,3.3,406,8.7,14.5,602.603,5.3,7.0,.753,1.3,6.8,8.0,7.3,1.7,0.9,3.0,1.4,26.8 12 2013-14,29,MIA, NBA, PF,77,77,37.7,10.0,17.6,567,1.5,4.0,.379,8.5,13.6,622,610,5.7,7.6,750,1.1,5.9,6.9,6.3,1.6,0.3,3.5,1.6,27.1 13 2014-15,30,CLE,NBA,SF,69,69,36.1,9.0,18.5,488,1.7,4.9,.354,7.3,13.6,536.535,5.4,7.7,.710,0.7,5.3,6.0,7.4,1.6,0.7,3.9,2.0,25.3 14 2015-16,31,CLE,NBA,SF,76,76,35.6,9.7,18.6,520,1.1,3.7,.309,8.6,14.9,573,551,4.7,6.5,.731,1.5,6.0,7.4,6.8,1.4,0.6,3.3,1.9,25.3 15 2016-17,32,CLE,NBA,SF,52,52,37.5,9.7,18.0,539,1.8,4.5,389,7.9,13.5,589,587,4.8,6.9,.689,1.2,6.5,7.7,8.8,1.4,0.6,4.3,1.7,25.9 16 Career,NBA,1039,1038,38.9,9.8,19.6,.500,1.4,4.0,.342,8.4,15.6,540,.535,6.1,8.3,.742,1.2,6.0,7.2,7.0,1.7,0.8,3.4,1.9,27.1 17 18 10 seasons,CLE, NBA,,745,744,39.3,9.8,20.2,484,1.4,4.3,.334,8.3,15.9,525,.520,6.2,8.5,736,1.2,5.8,7.0,7.1,1.7,0.8,3.4,1.9,27.2 19 4 seasons,,MIA, NBA 294,294,38.0,9.9,18.2,543,1.2,3.4,.369,8.7,14.9,582,577,5.9,7.8,.758,1.2,6.4,7.6,6.7,1.7,0.7,3.4,1.7,26.9

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
3 Ib-james
Q. Search Sheet
Home
Insert
Page Layout
Formulas
Data
Review
View
- 12
Insert.
Σ
Calibri (Body)
A A-
E Wrap Text
General
Ex Delete
Merge & Center
$ - % )
.0
.00
00 0
Conditional Format
Formatting as Table
Paste
BIU
+
Cell
Styles
O Format
A1
fx Season, Age,Tm, Lg,Pos,G,GS,MP,FG,FGA,FG%,3P,3PA,3P%,2P,2PA,2P%,eFG%,FT,FTA,FT%,ORB, DRB,TRB,AST,STL,BLK,TOV,PF,PTS
A
В
D
E
F
G
H
K
L
M
N
P
1 Season,Age, lm,Lg.Pos,G,GS,MP,FG,FGA,FG%,3P,3PA,3P%,2P,2PA,2P%,eFG%,FT,FTA,FT%,ORB,DRB,TRB,AST,STL,BLK,TOV,PF,PTS
2 2003-04,19,CLE,NBA,SG,79,79,39.5,7.9,18.9,.417,0.8,2.7,.290,7.1,16.1,.438,.438,4.4,5.8,.754,1.3,4.2,5.5,5.9,1.6,0.7,3.5,1.9,20.9
3 2004-05,20,CLE,NBA,SF,80,80,42.4,9.9,21.1,472,1.4,3.9,.351,8.6,17.2,499,.504,6.0,8.0,.750,1.4,6.0,7.4,7.2,2.2,0.7,3.3,1.8,27.2
4 2005-06,21,CLE,NBA,SF,79,79,42.5,11.1,23.1,.480,1.6,4.8,.335,9.5,18.3,.518,515,7.6,10.3,.738,0.9,6.1,7.0,6.6,1.6,0.8,3.3,2.3,31.4
5 2006-07,22,CLE,NBA,SF,78,78,40.9,9.9,20.8,.476,1.3,4.0,.319,8.6,16.8,.513,.507,6.3,9.0,.698,1.1,5.7,6.7,6.0,1.6,0.7,3.2,2.2,27.3
6 2007-08,23,CLE,NBA,SF,75,74,40.4,10.6,21.9,.484,1.5,4.8,.315,9.1,17.1,.531,.518,7.3,10.3,.712,1.8,6.1,7.9,7.2,1.8,1.1,3.4,2.2,30.0
7 2008-09,24,CLE,NBA,SF,81,81,37.7,9.7,19.9,489,1.6,4.7,.344,8.1,15.2,.535,.530,7.3,9.4,.780,1.3,6.3,7.6,7.2,1.7,1.1,3.0,1.7,28.4
8 2009-10,25,CLE,NBA,SF,76,76,39.0,10.1,20.1,.503,1.7,5.1,.333,8.4,15.0,.560,545,7.8,10.2,.767,0.9,6.4,7.3,8.6,1.6,1.0,3.4,1.6,29.7
9 2010-11,26,MIA, NBA, SF,79,79,38.8,9.6,18.8,.510,1.2,3.5,.330,8.4,15.3,.552,.541,6.4,8.4,.759,1.0,6.5,7.5,7.0,1.6,0.6,3.6,2.1,26.7
10 2011-12,27,MIA, NBA,SF,62,62,37.5,10.0,18.9,531,0.9,2.4,.362,9.1,16.5,.556,.554,6.2,8.1,.771,1.5,6.4,7.9,6.2,1.9,0.8,3.4,1.5,27.1
11 2012-13,28,MIA, NBA, PF,76,76,37.9,10.1,17.8,565,1.4,3.3,.406,8.7,14.5,.602,.603,5.3,7.0,.753,1.3,6.8,8.0,7.3,1.7,0.9,3.0,1.4,26.8
12 2013-14,29,MIA, NBA, PF,77,77,37.7,10.0,17.6,.567,1.5,4.0,.379,8.5,13.6,.622,.610,5.7,7.6,.750,1.1,5.9,6.9,6.3,1.6,0.3,3.5,1.6,27.1
13 2014-15,30,CLE,NBA,SF,69,69,36.1,9.0,18.5,.488,1.7,4.9,.354,7.3,13.6,.536,.535,5.4,7.7,.710,0.7,5.3,6.0,7.4,1.6,0.7,3.9,2.0,25.3
14 2015-16,31,CLE,NBA,SF,76,76,35.6,9.7,18.6,.520,1.1,3.7,.309,8.6,14.9,.573,.551,4.7,6.5,.731,1.5,6.0,7.4,6.8,1.4,0.6,3.3,1.9,25.3
15 2016-17,32,CLE,NBA,SF,52,52,37.5,9.7,18.0,.539,1.8,4.5,.389,7.9,13.5,.589,.587,4.8,6.9,.689,1.2,6.5,7.7,8.8,1.4,0.6,4.3,1.7,25.9
16 Career,,NBA,,1039,1038,38.9,9.8,19.6,.500,1.4,4.0,.342,8.4,15.6,.540,.535,6.1,8.3,.742,1.2,6.0,7.2,7.0,1.7,0.8,3.4,1.9,27.1
17
18 10 seasons,CLE,NBA,,745,744,39.3,9.8,20.2,.484,1.4,4.3,.334,8.3,15.9,.525,.520,6.2,8.5,.736,1.2,5.8,7.0,7.1,1.7,0.8,3.4,1.9,27.2
19 4 seasons, MIA, NBA,,294,294,38.0,9.9,18.2,.543,1.2,3.4,.369,8.7,14.9,.582,.577,5.9,7.8,.758,1.2,6.4,7.6,6.7,1.7,0.7,3.4,1.7,26.9
20
21
Transcribed Image Text:3 Ib-james Q. Search Sheet Home Insert Page Layout Formulas Data Review View - 12 Insert. Σ Calibri (Body) A A- E Wrap Text General Ex Delete Merge & Center $ - % ) .0 .00 00 0 Conditional Format Formatting as Table Paste BIU + Cell Styles O Format A1 fx Season, Age,Tm, Lg,Pos,G,GS,MP,FG,FGA,FG%,3P,3PA,3P%,2P,2PA,2P%,eFG%,FT,FTA,FT%,ORB, DRB,TRB,AST,STL,BLK,TOV,PF,PTS A В D E F G H K L M N P 1 Season,Age, lm,Lg.Pos,G,GS,MP,FG,FGA,FG%,3P,3PA,3P%,2P,2PA,2P%,eFG%,FT,FTA,FT%,ORB,DRB,TRB,AST,STL,BLK,TOV,PF,PTS 2 2003-04,19,CLE,NBA,SG,79,79,39.5,7.9,18.9,.417,0.8,2.7,.290,7.1,16.1,.438,.438,4.4,5.8,.754,1.3,4.2,5.5,5.9,1.6,0.7,3.5,1.9,20.9 3 2004-05,20,CLE,NBA,SF,80,80,42.4,9.9,21.1,472,1.4,3.9,.351,8.6,17.2,499,.504,6.0,8.0,.750,1.4,6.0,7.4,7.2,2.2,0.7,3.3,1.8,27.2 4 2005-06,21,CLE,NBA,SF,79,79,42.5,11.1,23.1,.480,1.6,4.8,.335,9.5,18.3,.518,515,7.6,10.3,.738,0.9,6.1,7.0,6.6,1.6,0.8,3.3,2.3,31.4 5 2006-07,22,CLE,NBA,SF,78,78,40.9,9.9,20.8,.476,1.3,4.0,.319,8.6,16.8,.513,.507,6.3,9.0,.698,1.1,5.7,6.7,6.0,1.6,0.7,3.2,2.2,27.3 6 2007-08,23,CLE,NBA,SF,75,74,40.4,10.6,21.9,.484,1.5,4.8,.315,9.1,17.1,.531,.518,7.3,10.3,.712,1.8,6.1,7.9,7.2,1.8,1.1,3.4,2.2,30.0 7 2008-09,24,CLE,NBA,SF,81,81,37.7,9.7,19.9,489,1.6,4.7,.344,8.1,15.2,.535,.530,7.3,9.4,.780,1.3,6.3,7.6,7.2,1.7,1.1,3.0,1.7,28.4 8 2009-10,25,CLE,NBA,SF,76,76,39.0,10.1,20.1,.503,1.7,5.1,.333,8.4,15.0,.560,545,7.8,10.2,.767,0.9,6.4,7.3,8.6,1.6,1.0,3.4,1.6,29.7 9 2010-11,26,MIA, NBA, SF,79,79,38.8,9.6,18.8,.510,1.2,3.5,.330,8.4,15.3,.552,.541,6.4,8.4,.759,1.0,6.5,7.5,7.0,1.6,0.6,3.6,2.1,26.7 10 2011-12,27,MIA, NBA,SF,62,62,37.5,10.0,18.9,531,0.9,2.4,.362,9.1,16.5,.556,.554,6.2,8.1,.771,1.5,6.4,7.9,6.2,1.9,0.8,3.4,1.5,27.1 11 2012-13,28,MIA, NBA, PF,76,76,37.9,10.1,17.8,565,1.4,3.3,.406,8.7,14.5,.602,.603,5.3,7.0,.753,1.3,6.8,8.0,7.3,1.7,0.9,3.0,1.4,26.8 12 2013-14,29,MIA, NBA, PF,77,77,37.7,10.0,17.6,.567,1.5,4.0,.379,8.5,13.6,.622,.610,5.7,7.6,.750,1.1,5.9,6.9,6.3,1.6,0.3,3.5,1.6,27.1 13 2014-15,30,CLE,NBA,SF,69,69,36.1,9.0,18.5,.488,1.7,4.9,.354,7.3,13.6,.536,.535,5.4,7.7,.710,0.7,5.3,6.0,7.4,1.6,0.7,3.9,2.0,25.3 14 2015-16,31,CLE,NBA,SF,76,76,35.6,9.7,18.6,.520,1.1,3.7,.309,8.6,14.9,.573,.551,4.7,6.5,.731,1.5,6.0,7.4,6.8,1.4,0.6,3.3,1.9,25.3 15 2016-17,32,CLE,NBA,SF,52,52,37.5,9.7,18.0,.539,1.8,4.5,.389,7.9,13.5,.589,.587,4.8,6.9,.689,1.2,6.5,7.7,8.8,1.4,0.6,4.3,1.7,25.9 16 Career,,NBA,,1039,1038,38.9,9.8,19.6,.500,1.4,4.0,.342,8.4,15.6,.540,.535,6.1,8.3,.742,1.2,6.0,7.2,7.0,1.7,0.8,3.4,1.9,27.1 17 18 10 seasons,CLE,NBA,,745,744,39.3,9.8,20.2,.484,1.4,4.3,.334,8.3,15.9,.525,.520,6.2,8.5,.736,1.2,5.8,7.0,7.1,1.7,0.8,3.4,1.9,27.2 19 4 seasons, MIA, NBA,,294,294,38.0,9.9,18.2,.543,1.2,3.4,.369,8.7,14.9,.582,.577,5.9,7.8,.758,1.2,6.4,7.6,6.7,1.7,0.7,3.4,1.7,26.9 20 21
Problem 3. LeBron Worship
For this problem we will marvel at how glorious a basketball player LeBron James is.
Go to http://www.basketball-reference.com/players/jamesle01.html, and click on the "Share & More"
menu, then click on the “Get table as CSV (for Excel)" menu item. Copy-paste-save the comma-
separated-values table from the web page to a file to be named Ib-james.csv.
The file should start with these 3 lines:
Season, Age, Tm,Lg Pas,G,GS,MPFG,PGA,FG%,3P,3PA,3P%,2P.2PA,2P%,eFG%,FTFIAFT%,ORB,DRB, TRBAST, STLBLK,TOVPEPTS
2003-04,19,CLE,NBA,SG,79,79,39.5,7.9,18.9,417,0.8,2.7,290,7.1,16.1,438, 438,4.4,5.8,754,1.34255,59,16,0.7,35,19.209
2004-05,20,CLE,NBA, SF,80,80,424,9.9,21.1,472,1.4,3.9.351,85,17.2,499,504,6.0,8.0,750,14,507472,22,0.7,331872
In case you wonder what the stats mean, the web page gives an explanation for each column. Just hover
the mouse on top of the header.
Write the code for this problem in a new file p3.py.
a) Write a function called get_csv_data) that takes these parameters:
• f: an open file object in CSV format (similar to our Ib-james.csv file), where the first line has
only column headings, followed by lines with comma-separated data items,
• string_pos_Ist: a list with index positions (starting from 0) for columns that have a string
format. For the lb-james.csv file, this list should be (0, 2, 3, 4). All other columns are assumed
to have a float format. Assume that this list is not sorted in any way.
• sep: a string representing the column separator with default value ","
The function get_csv_data returns a nested list we call here data_Ist, as follows:
• i reads the first line from file f (with the column headings) and adds to data_lst a list with the
column heading strings,
• after that first line, it reads file f line by line and parses each line based on the string pos_Ist
parameter. All columns on a line are assumed to be floats if not specifically indicated in the
string pos_Ist list. The function adds the list with parsed tokens (floats orland strings) to the
data_Ist list. Lines with at least one parsing error are ignored. E.g. trying to call float(") will
raise ValueError; we skip this entire line and go to the next one.
Error handling: check parameters for invalid values (e.g. sep==empty string). It is acceptable for this
function to throw/raise IndexError and errors related to I/O failures.
Transcribed Image Text:Problem 3. LeBron Worship For this problem we will marvel at how glorious a basketball player LeBron James is. Go to http://www.basketball-reference.com/players/jamesle01.html, and click on the "Share & More" menu, then click on the “Get table as CSV (for Excel)" menu item. Copy-paste-save the comma- separated-values table from the web page to a file to be named Ib-james.csv. The file should start with these 3 lines: Season, Age, Tm,Lg Pas,G,GS,MPFG,PGA,FG%,3P,3PA,3P%,2P.2PA,2P%,eFG%,FTFIAFT%,ORB,DRB, TRBAST, STLBLK,TOVPEPTS 2003-04,19,CLE,NBA,SG,79,79,39.5,7.9,18.9,417,0.8,2.7,290,7.1,16.1,438, 438,4.4,5.8,754,1.34255,59,16,0.7,35,19.209 2004-05,20,CLE,NBA, SF,80,80,424,9.9,21.1,472,1.4,3.9.351,85,17.2,499,504,6.0,8.0,750,14,507472,22,0.7,331872 In case you wonder what the stats mean, the web page gives an explanation for each column. Just hover the mouse on top of the header. Write the code for this problem in a new file p3.py. a) Write a function called get_csv_data) that takes these parameters: • f: an open file object in CSV format (similar to our Ib-james.csv file), where the first line has only column headings, followed by lines with comma-separated data items, • string_pos_Ist: a list with index positions (starting from 0) for columns that have a string format. For the lb-james.csv file, this list should be (0, 2, 3, 4). All other columns are assumed to have a float format. Assume that this list is not sorted in any way. • sep: a string representing the column separator with default value "," The function get_csv_data returns a nested list we call here data_Ist, as follows: • i reads the first line from file f (with the column headings) and adds to data_lst a list with the column heading strings, • after that first line, it reads file f line by line and parses each line based on the string pos_Ist parameter. All columns on a line are assumed to be floats if not specifically indicated in the string pos_Ist list. The function adds the list with parsed tokens (floats orland strings) to the data_Ist list. Lines with at least one parsing error are ignored. E.g. trying to call float(") will raise ValueError; we skip this entire line and go to the next one. Error handling: check parameters for invalid values (e.g. sep==empty string). It is acceptable for this function to throw/raise IndexError and errors related to I/O failures.
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Phases of web development
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