Date: August 28th, 2024
This Python script analyzes bike share data for three major cities in the United States. It provides an interactive command-line interface for users to explore various statistics about bike usage patterns.
- Data loading and filtering by city, month, and day
- Time statistics (most frequent times of travel)
- Station statistics (most popular stations and trips)
- Trip duration statistics
- User statistics
- Option to view raw data
- Main script:
bikeshare.py
- Data directory: Store
chicago.csv
,new_york_city.csv
andwashington.csv
data files.- Refer to detailed instructions in the data directory.
- Project setup files:
environment.yml
: Use with condarequirements.txt
: Use with pip
- Other files:
.gitignore
: Exclude files not required by project
- Python 3.12.4
- pandas 2.2.2
- numpy 1.26.4
For detailed requirements, see environment.yml
or requirements.txt
.
The specific versions listed above were used to develop and test this project. While these exact versions are recommended for the most consistent experience, the project may work with newer versions of these packages. If you encounter any issues with newer versions, please revert to the specified versions.
This project requires Python and the following Python libraries: pandas and numpy. You can set up the environment using either Conda or pip.
-
Fork the repository in GitHub.
-
Clone the repository:
git clone https://github.com/<your_username>/project_bikeshare.git cd project_bikeshare
-
If you don't have Conda installed, follow instructions on installing conda.
-
Follow instructions in common steps.
-
Create a new Conda environment using the provided
environment.yml
file:conda env create -f environment.yml
-
Activate the new conda environment:
conda activate project_bikeshare
Alternatively, you can create the Conda environment manually:
conda create --name project_bikeshare python=3.12.4 pandas=2.2.2 numpy=1.26.4
conda activate project_bikeshare
-
Ensure you have Python installed on your system.
-
Follow instructions in common steps.
-
Create virtual environment (preferably in project folder):
python -m venv .venv
-
Activate the virtual environment:
# Bash $ source .venv/bin/activate # Windows Command Line .venv\Scripts\activate.bat # Windows Power Shell .venv\Scripts\Activate.ps1
-
Install the required packages:
pip install -r requirements.txt
Alternatively, you can install the packages manually:
pip install pandas==2.2.2 numpy==1.26.4
After setting up your environment, you can run the project using:
python bikeshare.py
This will start the interactive program that allows you to explore US bikeshare data. Follow the on-screen prompts to analyze the data.
In the development of this project, the following resources were consulted:
- Udacity - Programming for Data Science with Python
- DataCamp - Various Python and Data Analysis courses
- NumPy Documentation: https://numpy.org/doc/
- Pandas Documentation: https://pandas.pydata.org/docs/
- Python Type Hinting Documentation: https://docs.python.org/3/library/typing.html
- Learn Python Programming (Programiz): https://www.programiz.com/python-programming
- W3Schools Python Tutorial: https://www.w3schools.com/python/
- Python Crash Course (Book) by Eric Matthes
- Real Python - Python Statistics Fundamentals: https://realpython.com/python-statistics/
- GitHub's Python .gitignore template: https://github.com/github/gitignore/blob/main/Python.gitignore
- Python Standard Library Documentation: https://docs.python.org/3/library/
- Stack Overflow - Various threads on Python, Pandas, and data analysis
- Google Python Style Guide: https://google.github.io/styleguide/pyguide.html
These resources provided valuable insights into Python programming, data analysis techniques, and best practices in code organization and documentation.