
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
airports.dat and airlines.dat, respectively. Both were sourced from http://openflights.org/data.html.
![In [ ]: def extract_mins(time):
Extracts minute information from military time
Args:
time (float64): series of time given in military format.
Takes on values in 0.0-2359.0 due to float64 representation.
Returns:
array (float64): series of input dimension with minute information.
Should only take on integer values in 0-59
|||||
# [YOUR CODE HERE]
# You MUST add comments explaining your thought process,
# and the resources you used to solve this question (if any)
mins='blabla'
return mins
# test your code
test_ser = pd.Series ([1030.0, 1259.0, np.nan, 2475], dtype='float64')
extract_mins (test_ser)
# 0
# 1
# 2
# 3
#dtype: float64
30.0
59.0
NaN
NaN](https://content.bartleby.com/qna-images/question/672bf286-8abe-4b07-9ca1-0d5b2612956c/474a30d4-184f-40d3-9869-26f0223d9ecb/wwlznzb_thumbnail.png)
Transcribed Image Text:In [ ]: def extract_mins(time):
Extracts minute information from military time
Args:
time (float64): series of time given in military format.
Takes on values in 0.0-2359.0 due to float64 representation.
Returns:
array (float64): series of input dimension with minute information.
Should only take on integer values in 0-59
|||||
# [YOUR CODE HERE]
# You MUST add comments explaining your thought process,
# and the resources you used to solve this question (if any)
mins='blabla'
return mins
# test your code
test_ser = pd.Series ([1030.0, 1259.0, np.nan, 2475], dtype='float64')
extract_mins (test_ser)
# 0
# 1
# 2
# 3
#dtype: float64
30.0
59.0
NaN
NaN
![Question 1.1
It looks like the departure and arrival in flights were read in as floating-point numbers. Write two functions, extract_hour and extract_mins that
converts military time to hours and minutes, respectively. Hint: You may want to use modular arithmetic and integer division. Keep in mind that the data has not
been cleaned and you need to check whether the extracted values are valid. Replace all the invalid values with NaN. The documentation for
pandas.Series. where provided here should be helpful.
In [ ]: def extract_hour(time):
Extracts hour information from military time.
Args:
time (float64): series of time given in military format.
Takes on values in 0.0-2359.0 due to float64 representation.
Returns:
array (float64): series of input dimension with hour information.
Should only take on integer values in 0-23
# [YOUR CODE HERE]
# You MUST add comments explaining your thought process,
# and the resources you used to solve this question (if any)
hour 'blabla'
return hour
=
# test your code
test_ser = pd.Series ([1030.0, 1259.0, np.nan, 2400], dtype='float64')
extract_hour(test_ser)
10.0
12.0
NaN
NaN
# 0
# 1
# 2
# 3
#dtype: float64](https://content.bartleby.com/qna-images/question/672bf286-8abe-4b07-9ca1-0d5b2612956c/474a30d4-184f-40d3-9869-26f0223d9ecb/ldq0om_thumbnail.png)
Transcribed Image Text:Question 1.1
It looks like the departure and arrival in flights were read in as floating-point numbers. Write two functions, extract_hour and extract_mins that
converts military time to hours and minutes, respectively. Hint: You may want to use modular arithmetic and integer division. Keep in mind that the data has not
been cleaned and you need to check whether the extracted values are valid. Replace all the invalid values with NaN. The documentation for
pandas.Series. where provided here should be helpful.
In [ ]: def extract_hour(time):
Extracts hour information from military time.
Args:
time (float64): series of time given in military format.
Takes on values in 0.0-2359.0 due to float64 representation.
Returns:
array (float64): series of input dimension with hour information.
Should only take on integer values in 0-23
# [YOUR CODE HERE]
# You MUST add comments explaining your thought process,
# and the resources you used to solve this question (if any)
hour 'blabla'
return hour
=
# test your code
test_ser = pd.Series ([1030.0, 1259.0, np.nan, 2400], dtype='float64')
extract_hour(test_ser)
10.0
12.0
NaN
NaN
# 0
# 1
# 2
# 3
#dtype: float64
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 3 images

Knowledge Booster
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
- 17. List the network names and the number of shows per network. Take a screenshot now and paste it here. 18. List the average number of episodes in the table shows. Take a screenshot now and paste it here. 19. List the name of the shows that have more episodes than the average number of episodes in the table shows. Use a subquery. Do not hardcode the average number (that you obtained in the previous question). Take a screenshot now and paste it here.arrow_forwardThe pg2.np_2017camping table contains public use statistics for camping in 2017 from the National Park Service. To enable statistics to be calculated for all camping locations, restructure the table as a narrow table.Show results also.arrow_forwardThe InstantRide User Satisfaction team requires the average and maximum number of rides users have taken so far with InstantRide. In addition, they would like to know the total number of travels. However, they need these details with the corresponding column names Average, Maximum and Total by using the AVG, MAX and SUM functions. In order to accomplish this, you will first need to create a derived table from the TRAVELS table to pass the TRAVEL_ID count to the three mathematical functions.arrow_forward
- Read the data into a DataFrame with ID as the index. Convert the “Hired” column into Date/Time data type Create a new column with years of experience with the company at present without rounding. Create a new Boolean column for senior status with employees with at least 10 years of experience as senior and others are not. Create a new column for longevity pay equal to $150 per whole year of experience in the company. Create a list of column names for each data type in the DataFrtame.arrow_forwardEnter the data provided below into Excel in a column (for example A1:A8). Copy the data and transpose it where the leftmost cell is H1. What is the value in L1? 10, 20, 41, 57, 33, 51, q53, 23arrow_forwardFind all employees whose email address ends with @armyspy.com. Show EmployeeID, FirstName, LastName, EmailAddress and a new column named "ModifiedEmail" in which the '.com' of the EmailAddress has been replaced with '.net'arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- 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

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)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education