Note: Please fork the current Udacity repository so that you will have a remote repository in your Github account. Clone the remote repository to your local machine. Later, as a part of the project "Post your Work on Github", you will push your proposed changes to the remote repository in your Github account.
17 December, 2022
Explore US Bikeshare Data
This Python script was created for Project 2 of Udacity's Programming for Data Science Nanodegree (PDSND) and is used to investigate details relating to bike share systems in Chicago, New York City, and Washington, D.C. It reads data from csv files and generates descriptive statistics from it. It also accepts raw user input to create an interactive experience in the terminal to present these statistics.
- Python
- Text Editor (VScode was used, but there is Atom and Sublime too)
- Terminal
The data is provided by Motivate, which is a bike share system provider for many cities in the United States.
The data files for all three cities contain the same six columns:
- Start Time
- End Time
- Trip Duration (in seconds)
- Start Station
- End Station
- User Type (Subscriber or Customer)
The Chicago and New York City files also contain the following two columns:
- Gender
- Birth Year
- What is the most popular month for start time?
- What is the most popular day of week (Monday, Tuesday, etc.) for start time?
- What is the most popular hour of day for start time?
- What is the total trip duration and average trip duration?
- What is the most popular start station and most popular end station?
- What is the most popular trip?
- What are the counts of each user type?
- What are the counts of gender?
- What are the earliest (i.e. oldest person), most recent (i.e. youngest person), and most popular birth years?
Bikeshare.py chicago.csv new_york_city.csv washington.csv
-
Lessons in Introduction to Python
-
Read day of week, month, hour etc.:
https://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.dt.html https://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.dt.dayofweek.html
- Convert seconds to hours, minutes and seconds:
https://stackoverflow.com/questions/775049/how-to-convert-seconds-to-hours-minutes-and-seconds https://docs.python.org/3/library/functions.html#divmod
- Convert pandas series or dataframes to string:
https://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.to_string.html https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.to_string.html
- Concatenate strings of two columns:
https://stackoverflow.com/questions/19377969/combine-two-columns-of-text-in-dataframe-in-pandas-python http://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.str.cat.html#pandas.Series.str.cat