
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,:]

Step by stepSolved in 8 steps with 7 images

- Computer Science Objective: To create a JSON for Population census with objects and arrays Scenario: ABC Census Company is maintaining database on the survey taken. Application sends the details of schemes in the form of JSON Help to create a JSON with the information provided. Name Datatype of value Country String State String YearOfSurvey Number TotalPopulation String AgeGroup Object AgeGroup- Object : Name Datatype of value 0-14 Array 15-24 Array 25-44 Array 45-64 Array Above65 Array Array : Name Datatype of value male Number female Number You can assume any data for the mentioned JSON structure, provided it is matching the specified datatypearrow_forwardGDB and Getopt Class Activity activity [-r] -b bval value Required Modify the activity program from last week with the usage shown. The value for bval is required to be an integer as is the value at the end. In addition, there should only be one value. Since everything on the command line is read in as a string, these now need to be converted to numbers. You can use the function atoi() to do that conversion. You can do the conversion in the switch or you can do it at the end of the program. The number coming in as bval and the value should be added together to get a total. That should be the only value printed out at the end. Total = x should be the only output from the program upon success. Remove all the other print statements after testing is complete. Take a screenshot of the output to paste into a Word document and submit. Practice Compile the program with the -g option to load the symbol table. Run the program using gdb and use watch on the result so the program stops when the…arrow_forwardusing python in jupyter notebook; we were given a csv file called stolen_animals.csv which contained data on stolen animals in london . The original raw data was given like this; Count of Stolen Animals,Type of Animal,Borough,Type Of Offence,Animal Recovered,Year and Month1,Dog,Lambeth,Theft and Handling,Not Recovered,Jan-20101,Dog,Islington,Violence Against the Person,Not Recovered,Jan-2010 but have written a function which made each column into list, count of stolen animals into a list of integers and the rest into list of integers. I now need to create functions to find the average number of stolen animals and another to get a list of unique types of animals that have been stolen. To add we are not allowed to use packages and can only input/output to be done by open and close. Below is the specifications given for each functionarrow_forward
- write in c++Write a program that would allow the user to interact with a part of the IMDB movie database. Each movie has a unique ID, name, release date, and user rating. You're given a file containing this information (see movies.txt in "Additional files" section). The first 4 rows of this file correspond to the first movie, then after an empty line 4 rows contain information about the second movie and so forth. Format of these fields: ID is an integer Name is a string that can contain spaces Release date is a string in yyyy/mm/dd format Rating is a fractional number The number of movies is not provided and does not need to be computed. But the file can't contain more than 100 movies. Then, it should offer the user a menu with the following options: Display movies sorted by id Display movies sorted by release date, then rating Lookup a release date given a name Lookup a movie by id Quit the Program The program should perform the selected operation and then re-display the menu. For…arrow_forwardWrite a program that reads movie data from a CSV (comma separated values) file and output the data in a formatted table. The program first reads the name of the CSV file from the user. The program then reads the CSV file and outputs the contents according to the following requirements: Each row contains the title, rating, and all showtimes of a unique movie. A space is placed before and after each vertical separator ('|') in each row. Column 1 displays the movie titles and is left justified with a minimum of 44 characters. If the movie title has more than 44 characters, output the first 44 characters only. Column 2 displays the movie ratings and is right justified with a minimum of 5 characters. Column 3 displays all the showtimes of the same movie, separated by a space. Each row of the CSV file contains the showtime, title, and rating of a movie. Assume data of the same movie are grouped in consecutive rows. Hints: Use the find() function to find the index of a comma in each row of…arrow_forwardUsing JAVA OOP, needs to work on the eclipse IDE The international Olympics Committee has asked you to write a program to process their data and determine the medal winners for the pairs figure skating. You will be given a file named Pairs.txt.This file contains the data for each pair of skaters. The data consists of each skater’s name, their country and the score from each of eight judges on the technical aspects and on the performance aspects. A typical record in the file would be as follows: SmithJonesAustralia5.0 4.9 5.1 5.2 5.0 5.1 5.2 4.84.3 4.7 4.8 4.9 4.6 4.8 4.9 4.5 LennonMurrayEngland2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.83.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8GustoPetitotItalia4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.85.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8LahaiePetitFrance1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.85.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8BilodeauBernardCanada2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.84.1 4.2 4.3 4.8 4.9 4.6 4.0 4.5LahorePedroMexico3.2 3.1 3.8 3.9 3.0 3.6 3.9 3.35.9 5.8 5.8 5.8 5.9 5.6 5.0…arrow_forward
- No written by hand solutionarrow_forwardAssume you need to store book data in a structured manner. Either more books should be added, or books that are already there should only be removed from one side of the shelf. Choose the best data structure for this case and describe it. Give a dynamic example of how books are added to a shelf. Additionally, what happens when there isn't enough room in a data structure for new data to be added?arrow_forward- Write a line of code to look at the first few rows of the DataFrame in Python import csv # take a look at the datasurvey = pd.read_csv('https://raw.githubusercontent.com/fivethirtyeight/data/master/steak-survey/steak-risk-survey.csv') # YOUR CODE HEREarrow_forward
- The downloads include a python starter program (P9HashTable1.py) that reads an employee file, sets upthe data structures and then allows the user to search, add or delete employees from the database. Youmust store the employee file (EmployeeDB.csv) in the same folder as your python program. The pythonstarter program has some missing functions that you must provideThe deliverables this week are:1. A search function that will find an employee record based on the employee ID.• Use a hash function Mod(12) to convert empID to a position in the Hash Dictionary• Using the beginChain value in the Hash Dictionary, traverse the Employee linked list2. An insert function that will add a new employee to the database.• Check to see if this is the first node of the chain and process differently if it is3. A delete function that will remove an employee from the database.• You’re not physically removing the employee record, you’re just using the ptr to passover records that are deleted.4. After a…arrow_forwardP7arrow_forwardAnalyze the problems carefully. Create the programs of the following. 1. Ages and Stages (Fle name: Age_Lastname) Create a program that checks as to which stage an age is. Use the table below. Age 5-12 years Stage Grade-schooler 13-17 years Теen 18-21 years Young adult 2. LRT-2 Single Journey Fare Matrix (File name: LRT_Lastname) Create a program that displays the fare based on the entered destination. The starting station is Araneta-Cubao. Use the table below. Use the code destination to shorten the user's input. Destination Fare Recto (Re) J. Ruiz (Jr) Gilmore (Gi) PHP 20 PHP 15 PHP 10arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education





