Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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!

  1. Download Pittsburgh Healthy Ride datasets from https://drive.google.com/file/d/1NH5ZEjWF-XAIuOw52ge0aCX10534ipk-/view?usp=sharing

  2. Unzip the files and make sure that the list of subfolders is in the same folder as your Python script

    1. You should see the following list of subfolders:

      1. 2015-Q2

      2. 2015-Q3

      3. 2015-Q4

      4. 2016-Q1

      5. 2016-Q2

      6. 2016-Q3

      7. 2016-Q4

    2. Each subfolder contains two comma-separated values (.csv) files:

      1. HealthyRide Rentals [year] [quarter] (ex: HealthyRide Rentals 2015 Q2)

      2. HealthyRideStations[year] (ex: HealthyRideStations2015)

    3. 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

    4. Each HealthyRideStations[year] file contains the following fields: StationNum, StationName, RackQnty, Latitude, Longitude

    5. Note that From station id and To station id map to StationNum - you will need to join the two datasets on those identifiers

  3. Steps to complete the program

    1. Create two Pandas dataframes - one to store ride data and another to store station data

    2. For loop to iterate through subfolders and files

      1. 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

      2. 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Illuminated

Authors: Catherine M. Ricardo

1st Edition

0763733148, 978-0763733148

More Books

Students also viewed these Databases questions

Question

awew mat Al] wark styeit

Answered: 1 week ago