This repository contains two Python-based data analysis challenges: PyBank and PyPoll. The PyBank script analyzes financial records to determine key financial metrics, while the PyPoll script processes election data to count votes and determine the winning candidate. Both scripts read data from CSV files, perform necessary calculations, and output results both to the terminal and text files.
python-challenge/
│
├── PyBank/
│ ├── Resources/
│ │ ├── budget_data.csv
│ ├── analysis/
│ │ ├── financial_analysis.txt
│ ├── main.py
│
├── PyPoll/
│ ├── Resources/
│ │ ├── election_data.csv
│ ├── analysis/
│ │ ├── election_results.txt
│ ├── main.py
Analyze a company's financial records from budget_data.csv and calculate key financial metrics.
- Count the total number of months in the dataset.
- Compute the net total amount of "Profit/Losses" over the period.
- Determine the average change in "Profit/Losses" across the dataset.
- Identify the greatest increase and decrease in profits (including the corresponding dates).
- Print the analysis results to the terminal and export them to a text file.
Automate vote counting using election_data.csv to determine election results.
- Count the total number of votes cast.
- Generate a complete list of candidates who received votes.
- Calculate the percentage and total number of votes each candidate won.
- Determine the winner based on the popular vote.
- Print the analysis results to the terminal and export them to a text file.
- Clone this repository:
git clone https://github.com/your-username/python-challenge.git
- Navigate to the project directory:
cd python-challenge - Run the scripts:
- PyBank:
python PyBank/main.py
- PyPoll:
python PyPoll/main.py
- PyBank:
- Check the
analysis/folder for the exported text results.
- Python 3.x
- Pandas (optional but recommended for data analysis)