January 26, 2025
Bikeshare Data Analysis
This Python program analyzes bikeshare data for three major cities in the United States: Chicago, New York City, and Washington. It provides users with the ability to filter the data by month (from January to June) and day of the week, allowing for tailored analysis. The program calculates and displays various statistics that help explore the bikeshare system, such as:
- Most frequent travel times (month, day, hour)
- Most popular stations (start and end stations)
- Most frequent trips (combination of start and end stations)
- Trip duration statistics (total and average trip time)
- User demographics (user type, gender, birth year)
These insights can be used to identify trends and patterns in the bikeshare system, providing valuable information for decision-making or research.
The program requires CSV files containing data for each city. These files should be placed in the same directory as the script, or the file paths can be adjusted accordingly:
chicago.csvnew_york_city.csvwashington.csv
The CSV files must contain relevant data columns such as Start Time, End Time, Trip Duration, Start Station, End Station, User Type, Gender, and Birth Year.
python bikeshare.py
Select a city:
- Chicago
- New York City
- Washington
Enter your choice (1, 2, or 3): 1
Select a month (January to June or 'all' for no filter):
- January
- February
- March ... Enter your choice (1, 2, 3, ..., or 'all'): January
Select a day of the week (Monday to Sunday or 'all' for no filter):
- Monday
- Tuesday
- Wednesday ... Enter your choice (1, 2, 3, ..., or 'all'): all
Displaying statistics for Chicago for the month of January:
- Most frequent travel times (month, day, hour)
- Most popular stations
- Most frequent trips
- Total and average trip duration
- User statistics (user type, gender, birth year)
This project is inspired by and based on the Udacity Data Science program. Special thanks to Udacity for providing the course content and resources that helped shape the foundation of this project.
City Selection: Choose from three cities: Chicago, New York City, or Washington. Month Filter: Filter data for a specific month (January to June) or no filter. Day Filter: Filter data for a specific day of the week or no filter. Statistics Displayed:
- Most common travel times (month, day, and hour)
- Most popular stations and most frequent trips
- Total and average trip duration
- User statistics (user type, gender, birth year)
pandas– for data manipulation and analysisnumpy– for numerical operationstime– for handling time-related operations
To run this program, you will need the following Python libraries:
pip install pandas numpy