Date created
February 10, 2022
Project Title
Explore US Bikeshare Data
Description
This project was undertaken as part of Udacity's Programming for Data Science with Python.
It mainly uses Python to understand U.S. bikeshare data using data provided by Motivate.
The script is able to calculate statistics and build an interactive environment. In this interactive environment, raw user input as answers to a few questions will change the results:
- The city the user would like to see data from (there are 3 cities with available data);
- Whether the user wants to filter by month, day, or both;
- (If they choose month) which month;
- (If they choose day) which day;
- (If they choose both) which month and day.
Afterwards, the script will:
- Filter the data based on the answers;
- Display statistical data for the user;
- Ask whether they want to see raw data displayed (5 lines at a time);
- Ask whether they want to start again or exit.
Files used
data/chicago.csv
data/new_york_city.csv
data/washington.csv
Credits
-
I used the Pandas documentation page a lot, especially on how to handle the to_datetime function and extract the month and day of the week using the dt.month_name() and dt.day_name() methods.
-
I decided to allow the user to filter the DataFrame by both the month and day, but I ran into some errors while trying to get the mode() over those two columns. A StackOverflow discussion and a Kite post helped me achieving that.
-
In addition to Pandas and Numpy, the Udacity reviewer kindly recommended I use Tabulate to better display raw user data.
-
Afterwards, I had the idea to search how to create a requirements.txt file using conda. Conda documentation helped me generate the file.