# NYC Taxi Data Analysis ππ
This repository contains a Jupyter Notebook that analyzes NYC taxi trip data using NumPy. The dataset (`nyc_taxis.csv`) contains information about taxi rides, including trip distance, fare amount, and payment methods.
## π Features & Analysis
- **Load Data:** Import and preprocess NYC taxi trip data.
- **Speed Calculation:** Compute average speed of taxi rides.
- **Ride Count in February:** Filter and count rides that happened in February.
- **Expensive Rides:** Count rides with fare amounts greater than $50.
- **Credit Card Transactions:** Count rides paid via credit cards.
## π Files
- `analysis.ipynb` - Jupyter Notebook with all the analysis.
- `nyc_taxis.csv` - The dataset containing taxi ride details.
## π οΈ Installation & Usage
1. Clone the repository:
```sh
git clone https://github.com/your-username/nyc-taxi-analysis.git
- Navigate to the project directory:
cd nyc-taxi-analysis
- Install dependencies:
pip install numpy jupyter
- Run the Jupyter Notebook:
jupyter notebook
import numpy as np
taxi = np.genfromtxt('nyc_taxis.csv', delimiter=',', skip_header=True)
speed = taxi[:, 7] / (taxi[:, 8] / 3600)
mean_speed = speed.mean()
print(mean_speed)
rides_feb = taxi[taxi[:, 1] == 2, 1]
print(rides_feb.shape[0])
expensive_rides = taxi[taxi[:, -3] > 50, -3].shape[0]
print(expensive_rides)
credit_card_rides = taxi[taxi[:, 6] == 2, 6].shape[0]
print(credit_card_rides)
- The average taxi speed is approximately 32.24 mph.
- There were 13,333 rides in February.
- 16 rides had fares exceeding $50.
- 11,832 rides were paid using credit cards.
Feel free to fork this repo and contribute by improving analysis or adding visualizations!
This project is open-source and available under the MIT License.
This README provides:
β
Clear description
β
Code snippets
β
Setup guide
β
Insights from analysis