Question
I need help with doing step 3 part 2...I am not sure how to tackle the problem. Thank you! Download Pittsburgh Healthy Ride datasets from
I need help with doing step 3 part 2...I am not sure how to tackle the problem. Thank you!
-
Download Pittsburgh Healthy Ride datasets from https://drive.google.com/file/d/1NH5ZEjWF-XAIuOw52ge0aCX10534ipk-/view?usp=sharing
-
Unzip the files and make sure that the list of subfolders is in the same folder as your Python script
-
You should see the following list of subfolders:
-
2015-Q2
-
2015-Q3
-
2015-Q4
-
2016-Q1
-
2016-Q2
-
2016-Q3
-
2016-Q4
-
-
Each subfolder contains two comma-separated values (.csv) files:
-
HealthyRide Rentals [year] [quarter] (ex: HealthyRide Rentals 2015 Q2)
-
HealthyRideStations[year] (ex: HealthyRideStations2015)
-
-
Each HealthyRide Rentals [year] [quarter] file contains the following fields (columns): Tripid, Starttime, Stoptime, Bikeid, Tripduration, From station id, From station name, To station id, To station name, Usertype
-
Each HealthyRideStations[year] file contains the following fields: StationNum, StationName, RackQnty, Latitude, Longitude
-
Note that From station id and To station id map to StationNum - you will need to join the two datasets on those identifiers
-
-
Steps to complete the program
-
Create two Pandas dataframes - one to store ride data and another to store station data
-
For loop to iterate through subfolders and files
-
Append each row from HealthyRide Rentals [year] [quarter] to the dataframe of ride data. An easy way to do this would be to create a temporary dataframe inside the loop, read in the data, and append the temporary dataframe to the master dataframe. Hint: you will need to use the .concat() or .append() function: https://pandas.pydata.org/pandas-docs/stable/merging.html
-
For the HealthyRideStations[year] file append only unique rows. In other words, you need to make sure that the dataset that contains stations data does not have duplicates.
-
-
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started