Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wrighang/03_python-challenge
Module 3: Python
https://github.com/wrighang/03_python-challenge
for-loop load-csv python-lists python-script
Last synced: 4 days ago
JSON representation
Module 3: Python
- Host: GitHub
- URL: https://github.com/wrighang/03_python-challenge
- Owner: wrighang
- Created: 2024-10-15T17:54:41.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2025-01-03T23:22:43.000Z (24 days ago)
- Last Synced: 2025-01-04T00:22:28.840Z (24 days ago)
- Topics: for-loop, load-csv, python-lists, python-script
- Language: Python
- Homepage:
- Size: 1.57 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 03_python-challenge
# Deliverable(s)
[PyBank.py](https://github.com/wrighang/03_python-challenge/blob/main/PyBank/main.py)[PyPoll.py](https://github.com/wrighang/03_python-challenge/blob/main/PyPoll/main.py)
## PyBank Instructions
In this challenge, you are tasked with creating a Python script to analyze the financial records of your company.
You will be given a financial dataset called `budget_data.csv`. The dataset is composed of two columns:
- "Date"
- "Profit/Losses"Your task is to create a Python script that analyzes the records to calculate each of the following values:
- The total number of months included in the dataset
- The net total amount of "Profit/Losses" over the entire period
- The changes in "Profit/Losses" over the entire period, and then the average of those changes
- The greatest increase in profits (date and amount) over the entire period
- The greatest decrease in profits (date and amount) over the entire period## PyBank Instructions
In this challenge, you are tasked with creating a Python script to analyze the financial records of your company.
You will be given a financial dataset called `budget_data.csv`. The dataset is composed of two columns:
- "Date"
- "Profit/Losses"Your task is to create a Python script that analyzes the records to calculate each of the following values:
- The total number of months included in the dataset
- The net total amount of "Profit/Losses" over the entire period
- The changes in "Profit/Losses" over the entire period, and then the average of those changes
- The greatest increase in profits (date and amount) over the entire period
- The greatest decrease in profits (date and amount) over the entire period## Requirements
### Correctly Reads in the CSV
Reads in the CSVs for both PyBank and PyPoll using Python:
- Reads and stores header row### Results Printed to Terminal
Results correctly display for PyBank:
- Total Months
- Total
- Average Change
- Greatest Increase
- Greatest DecreaseResults correctly display for PyPoll:
- Total Votes
- Each candidate’s total votes and percent of votes
- Winner### Code Runs Error Free
- Runs without errors
- Produces consistent results### Exports Results to Text File
The text file contains the following for PyBank:
- Total Months
- Total
- Average Change
- Greatest Increase
- Greatest DecreaseThe text file contains the following for PyPoll:
- Total Votes
- Each candidate’s total votes and percent of votes
- Winner### Code is Cleaned and Commented
- Additional tests and debugging removed
- Code is properly commented============================================================================
## CODING_PROCESSPyBank- I began with looking at the Excel sheet to see how I would solve for intended results. After I was able to solve it in Excel, I began writing the python code and broke it out into section to follow the path of how I would solve it manually in Excel. I was able to calculate the # number of month, however, i had trouble figuring out how to do the sum of the profit/loss column and used learning assistance for help to better understand the adding of the increments. There were a few other road blocks along the way with how to structure the code and i used learning assistant to explain what i was trying to achieve which helped. I also used it for finding out how to create and write to a text file. The final py doc is the cleaned up version from the various attemps I had made to achieve the correct result.
PyPoll- I begin looking at Excel to solve this sheet as well, however, it was a bit tricker as I couldn't figure out how to capture unique values. In Thursdays class, it was suggested to create a dictionay which then I applied to my code and with some xpert assistant i was able to figure out how to call out the unique candidates as well as count the votes.
For both .py docs i created comments throughout to code to illustrate my thought process and understanding of what each line is doing.