This project includes two Python scripting tasks: PyBank and PyPoll. Both tasks utilize Python to analyze real-world datasets, one for financial analysis and the other for election vote counting.
In this challenge, a Python script is created to analyze financial records from a dataset (budget_data.csv
) with the following details:
- Dataset Columns: Date, Profit/Losses
- Tasks:
- Calculate the total number of months in the dataset.
- Compute the net total of "Profit/Losses" over the entire period.
- Calculate the changes in "Profit/Losses" and the average of those changes.
- Identify the greatest increase in profits (date and amount).
- Identify the greatest decrease in profits (date and amount).
The script outputs the analysis to the terminal and saves the results to a text file.
In this challenge, we are tasked with analyzing election data from the dataset (election_data.csv
) to help automate the vote-counting process. The dataset contains the following columns:
- Dataset Columns: Voter ID, County, Candidate
- Tasks:
- Count the total number of votes cast.
- List all candidates who received votes.
- Calculate the percentage of votes each candidate won.
- Calculate the total votes for each candidate.
- Determine the winner of the election based on popular vote.
The script outputs the analysis to the terminal and saves the results to a text file.
- Python: Scripting language used for data analysis.
- Pandas: Library used for data manipulation and analysis.
- Clone this repository.
- Install the required Python packages.
- Run the
pybank.py
orpypoll.py
script in a Python environment. - Results will be displayed in the terminal and saved as a
.txt
file.
- Sakina Jaffri - Python scripting, data analysis, and report generation.