Transitioning from using Excel to programming with Python, I've undertaken an assignment involving two Python challenges: PyBank and PyPoll. These tasks are designed to apply my new Python scripting skills to real-world scenarios.
Before starting the assignment, the following steps needs to be completed:
Before diving into the assignment, I followed these preparatory steps:
- Repository Setup: Created a new repository named python-challenge.
- Cloning the Repository: Cloned the repository to my local machine.
- Directory Structure: Created two folders within the repository: PyBank and PyPoll.
- File Preparation: Within each folder, added:
- main.py: The main script for the analysis.
- Resources folder: Contained the necessary CSV files.
- analysis folder: Held the text file with the results of the analysis.
- Pushing Changes: Committed and pushed these changes to GitHub/GitLab.
Objective
Develop a Python script to analyze financial records in a dataset named budget_data.csv, containing two columns: "Date" and "Profit/Losses".
Tasks
- Calculate the total number of months included in the dataset.
- Compute the net total amount of "Profit/Losses" over the period.
- Calculate the changes in "Profit/Losses" over the period and find the average of these changes.
- Identify the greatest increase in profits (date and amount).
- Identify the greatest decrease in profits (date and amount).
Deliverables
- Print the analysis results to the terminal.
- Export a text file with the analysis results.
My analysis should align with the following results:
Objective Create a Python script to modernize the vote-counting process using data from election_data.csv, which contains "Voter ID", "County", and "Candidate" columns.
Tasks
- Determine the total number of votes cast.
- Generate a complete list of candidates who received votes.
- Calculate the percentage of votes each candidate received.
- Calculate the total number of votes each candidate received.
- Identify the winner of the election based on the popular vote.
Deliverables
- Print the analysis results to the terminal.
- Export a text file with the analysis results.
My analysis should align with the following results:
- Use Python modules like csv for file handling.
- Utilize data structures such as variables, lists, and dictionaries for data storage and manipulation.
- Employ iteration for processing data.
- Debug the scripts to ensure accuracy.
- Handle large datasets efficiently, showcasing the limitations of Excel and the advantages of Python scripting.
Workflow
- Script Development: Write separate scripts for each dataset.
- Testing: Run each script individually to verify functionality.
- Version Control: Commit work regularly and push changes to GitHub to prevent data loss.
- Documentation: Ensure the repository includes a comprehensive README.md file detailing the project.
-
Data for this dataset was generated by edX Boot Camps LLC, and is intended for educational purposes only.
-
Python File Write (https://www.w3schools.com/python/python_file_write.asp)
-
Markdown-Here (https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet)
-
Markdown-Cheatsheet (https://github.com/tchapi/markdown-cheatsheet/blob/master/README.md)



