11.2.1: Subsetting dataframes using pandas.

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
CHALLENGE
ACTIVITY
11.2.1: Subsetting dataframes using pandas.
482934.3374524.qx3zqy7
Jump to level 1
This dataset contains information on taxi journeys during March 2019 in New York City. The data includes passengers, distance,
fare, tip, tolls, and total.
• Display all rows of the taxicabsNY dataframe where the tip column is > 3.
The code contains all imports, loads the dataset, and prints the column.
main.py taxi.csv
1 # Loads necessary packages
2 import pandas as pd
3
4# Loads the taxi.csv dataset
5 taxicabsNY
6
7 # Subset taxi cabsNY using comparison operators
8 df
9
10 # Prints the column
11 print (df)
=
pd. read_csv('taxi.csv')
1
2
3
4
□
5
Transcribed Image Text:CHALLENGE ACTIVITY 11.2.1: Subsetting dataframes using pandas. 482934.3374524.qx3zqy7 Jump to level 1 This dataset contains information on taxi journeys during March 2019 in New York City. The data includes passengers, distance, fare, tip, tolls, and total. • Display all rows of the taxicabsNY dataframe where the tip column is > 3. The code contains all imports, loads the dataset, and prints the column. main.py taxi.csv 1 # Loads necessary packages 2 import pandas as pd 3 4# Loads the taxi.csv dataset 5 taxicabsNY 6 7 # Subset taxi cabsNY using comparison operators 8 df 9 10 # Prints the column 11 print (df) = pd. read_csv('taxi.csv') 1 2 3 4 □ 5
Taxi.csv
passengers, distance, fare,tip,tolls, total
1,1.05,6.5, 1.0,0.0,11.3
1,0.83,5.5,0.0,0.0,9.3
3,0.92,5.5,0.0,0.0,8.8
5,0.47,3.5,0.0,0.0,6.8
1,18.99,50.5,10.26,0.0,61.56
1,0.2,4.0,0.0,0.0,7.3
1,8.84,32.0,0.0,5.76,42.06
5,2.47,17.5,4.26,0.0,25.56
1,1.94,13.0,4.08,0.0,20.38
2,1.9,10.0,2.0,0.0,15.3
1,0.53,4.0,0.0,0.0,7.3
0,2.3,12.5,1.2,0.0,17.0
4,1.46,13.5,3.36,0.0,20.16
1,2.19,9.0,3.08,0.0,15.38
1,18.0,52.0,12.2,5.76,73.26
1,4.83,17.0,0.0,0.0,17.8
6,2.72,12.5,3.16,0.0,18.96
1,12.9,42.5,10.3,5.76,61.86
1,9.63,31.0,1.0,5.76,39.06
1,0.9,5.5,0.0,0.0,9.3
1,1.42,9.0,2.66,0.0,15.96
1,13.3,37.0,11.6,5.76,58.16
3,1.24,6.5,1.5,0.0,11.8
4,1.94,10.0,2.66,0.0,15.96
1,1.86,9.5,0.0,0.0,13.8
1,2.9,17.0,0.0,0.0,20.3
2,5.24,18.0,4.36,0.0,26.16
1,0.8,6.0,1.0,0.0,10.3
1,1.89,10.5,0.0,0.0,13.8
1,0.0,2.5,0.0,0.0,5.8
1,1.7,13.0,2.0,0.0,19.3
6,1.45,11.0,0,0,0.0,14.3
1,0.81,5.5,1.76,0.0,10.56
2,2.54,12.5,3.16,0.0,18.96
1,0.48,4.5,1.0,0.0,8.8
2,1.66,14.5,0.0,0.0,17.8
1,1.0,7.5,3.2,0.0,14.0
2,2.22,10.5,2.26,0.0,13.56
1,3.37,13.0,1.0,0.0,17.8
1,0.37,4.0,1.46,0.0,8.76
1,2.7,13.5,3.35,0.0,20.15
1,1.3,10.0,2.85,0.0,17.15
1,2.5,14.5,3.56,0.0,21.36
1,7.1,25.5,4.32,0.0,33.12
1,0.7,5.5,1.85,0.0,11.15
1,2.3,18.0,4.25,0.0,25.55
1,1.1,6.0,0.39,0.0,8.19
1,2.0,8.5,0.0,0.0,9.8
2,3.67,18.0,4.41,0.0,26.46
1,1.62,8.0,0.0,0.0,8.8
Transcribed Image Text:Taxi.csv passengers, distance, fare,tip,tolls, total 1,1.05,6.5, 1.0,0.0,11.3 1,0.83,5.5,0.0,0.0,9.3 3,0.92,5.5,0.0,0.0,8.8 5,0.47,3.5,0.0,0.0,6.8 1,18.99,50.5,10.26,0.0,61.56 1,0.2,4.0,0.0,0.0,7.3 1,8.84,32.0,0.0,5.76,42.06 5,2.47,17.5,4.26,0.0,25.56 1,1.94,13.0,4.08,0.0,20.38 2,1.9,10.0,2.0,0.0,15.3 1,0.53,4.0,0.0,0.0,7.3 0,2.3,12.5,1.2,0.0,17.0 4,1.46,13.5,3.36,0.0,20.16 1,2.19,9.0,3.08,0.0,15.38 1,18.0,52.0,12.2,5.76,73.26 1,4.83,17.0,0.0,0.0,17.8 6,2.72,12.5,3.16,0.0,18.96 1,12.9,42.5,10.3,5.76,61.86 1,9.63,31.0,1.0,5.76,39.06 1,0.9,5.5,0.0,0.0,9.3 1,1.42,9.0,2.66,0.0,15.96 1,13.3,37.0,11.6,5.76,58.16 3,1.24,6.5,1.5,0.0,11.8 4,1.94,10.0,2.66,0.0,15.96 1,1.86,9.5,0.0,0.0,13.8 1,2.9,17.0,0.0,0.0,20.3 2,5.24,18.0,4.36,0.0,26.16 1,0.8,6.0,1.0,0.0,10.3 1,1.89,10.5,0.0,0.0,13.8 1,0.0,2.5,0.0,0.0,5.8 1,1.7,13.0,2.0,0.0,19.3 6,1.45,11.0,0,0,0.0,14.3 1,0.81,5.5,1.76,0.0,10.56 2,2.54,12.5,3.16,0.0,18.96 1,0.48,4.5,1.0,0.0,8.8 2,1.66,14.5,0.0,0.0,17.8 1,1.0,7.5,3.2,0.0,14.0 2,2.22,10.5,2.26,0.0,13.56 1,3.37,13.0,1.0,0.0,17.8 1,0.37,4.0,1.46,0.0,8.76 1,2.7,13.5,3.35,0.0,20.15 1,1.3,10.0,2.85,0.0,17.15 1,2.5,14.5,3.56,0.0,21.36 1,7.1,25.5,4.32,0.0,33.12 1,0.7,5.5,1.85,0.0,11.15 1,2.3,18.0,4.25,0.0,25.55 1,1.1,6.0,0.39,0.0,8.19 1,2.0,8.5,0.0,0.0,9.8 2,3.67,18.0,4.41,0.0,26.46 1,1.62,8.0,0.0,0.0,8.8
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Race Condition
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
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