Please answer the questions with codes and comments. Please complete the problems on jupyter notebook

1 answer below »
Please answer the questions with codes and comments. Please complete the problems on jupyter notebook
Answered Same DayMar 17, 2023

Answer To: Please answer the questions with codes and comments. Please complete the problems on jupyter...

Baljit answered on Mar 18 2023
34 Votes
3/18/23, 11:49 AM Untitled - Jupyter Notebook
localhost:8888/notebooks/Untitled Folder/Untitled.ipynb 1/6
Library imports
In [1]:
I
mport database into a variable data
In [2]:
import sqlite3
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
data = sqlite3.connect('lahmansbaseballdb.sqlite')
3/18/23, 11:49 AM Untitled - Jupyter Notebook
localhost:8888/notebooks/Untitled Folder/Untitled.ipynb 2/6
Selection of data between year 2006 and 2016
Exercise 1
In [3]: df = pd.read_sql_query("SELECT *,sum(salary) FROM Salaries WHERE yearID BETWEE
display(df)
3/18/23, 11:49 AM Untitled - Jupyter Notebook
localhost:8888/notebooks/Untitled Folder/Untitled.ipynb 3/6
ID yearID teamID team_ID lgID playerID salary sum(salary)
0 17756 2006 NYA 2523 AL cairomi01 1000000.0 2.263671e+09
1 17378 2006 BOS 2509 AL bardjo01 353400.0 1.675458e+09
2 17676 2006 LAN 2520 NL alomasa02 650000.0 1.598053e+09
3 17544 2006 DET 2515 AL bondeje01 2300000.0 1.457055e+09
4 17836 2006 PHI 2526 NL abreubo01 13600000.0 1.399510e+09
5 17651 2006 LAA 2519 AL alfoned01 8000000.0 1.347061e+09
6 17946 2006 SFN 2530 NL accarje01 330000.0 1.315003e+09
7 17431 2006 CHN 2511 NL barremi01 4333333.0 1.243140e+09
8 17784 2006 NYN 2524 NL bannibr01 327000.0 1.215769e+09
9 17405 2006 CHA 2510 AL anderbr03 330000.0 1.186187e+09
10 17972...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here