Storing tabular data as pandas dataframe: Data preprocessing is one of the steps in machine learning. The pandas library in python is suitable to deal with tabular data. Create a variable ‘emissions’ and assign to it the following data (Table 1) as padas DataFrame. Create an excel file ‘emissions_from_pandas.xlsx’ from the ‘emissions’ variable using python. Table 1. Particulate matter (PM) emissions (in g/gal) for 15 vehicles driven at low altitude and another 15 vehicles driven at high altitude. Low Altitude High Altitude 1.50 7.59 1.48 2.06 2.98 8.86 1.40 8.67 3.12 5.61 0.25 6.28 6.73 4.04 5.30 4.40 9.30 9.52 6.96 1.50 7.21 6.07 0.87 17.11 1.06 3.57 7.39 2.68 1.37 6.46 iloc[] method: (b) Using the .iloc[] method, we can access any part of the dataframe. Run the following commands and show the outputs: emissions.head() emissions.iloc[0,0] emissions.iloc[1,1] emissions.iloc[0:2,0:2] emissions.iloc[2:4,:]
Storing tabular data as pandas dataframe:
(a) Data preprocessing is one of the steps in machine learning. The pandas library in python is suitable to deal with tabular data. Create a variable ‘emissions’ and assign to it the following data (Table 1) as padas DataFrame. Create an excel file ‘emissions_from_pandas.xlsx’ from the ‘emissions’ variable using python.
Table 1. Particulate matter (PM) emissions (in g/gal) for 15 vehicles driven at low altitude and another 15 vehicles driven at high altitude.
Low Altitude |
High Altitude |
1.50 |
7.59 |
1.48 |
2.06 |
2.98 |
8.86 |
1.40 |
8.67 |
3.12 |
5.61 |
0.25 |
6.28 |
6.73 |
4.04 |
5.30 |
4.40 |
9.30 |
9.52 |
6.96 |
1.50 |
7.21 |
6.07 |
0.87 |
17.11 |
1.06 |
3.57 |
7.39 |
2.68 |
1.37 |
6.46 |
iloc[] method:
(b) Using the .iloc[] method, we can access any part of the dataframe. Run the following commands and show the outputs:
emissions.head()
emissions.iloc[0,0]
emissions.iloc[1,1]
emissions.iloc[0:2,0:2]
emissions.iloc[2:4,:]
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 8 steps with 7 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![(b) Use the panda's library in python to generate a comparative boxplot of the emissions dataset. Interpret the
boxplot (max 50 words)
(c) Use Excel to compute the statistics as discussed in part (a) and draw the comparative boxplot mentioned in part
(b). The screenshot with your work may look like the following for the summary statistics part.
Low
Altitude
1.50
1.48
2.98
1.40
3.12
0.25
6.73
5.30
9.30
6.96
7.21
0.87
1.06
7.39
1.37
High
Altitude
7.59
2.06
8.86
8.67
5.61
6.28
4.04
4.40
9.52
1.50
6.07
17.11
3.57
2.68
6.46
count
mean
std
min
25%
50%
75%
max
Low
Altitude
High
Altitude](https://content.bartleby.com/qna-images/question/008f31aa-ffde-472d-81b9-49fb75f4a0c2/807a6383-13d4-4690-9fa1-01f0c2516414/rtejhnq_thumbnail.png)
File conversion:
(c) Create an xl file "emissions_from_pandas.xlsx" from the emissions variable using the .to_excel method. Paste the screenshot of the input command.
(d) Create an MS Excel file ‘emissions_excel.xlsx’ containing the data in Table 1 above with the column header and save it on your computer. Create a variable ‘emissions_from_excel’ from the ‘emissions_excel.xlsx’ file using pd_read function. Show the first five rows using .head(). Paste a screenshot with the input commands used.
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)