RoshniRanaDS27/Python_for_Financial_Analysis_and_Election_results_Analysis
Python for Financial Analysis for Banking records and 2. Election Results Analysis (For Rural area).
Python
Python for Financial Analysis and Election results Analysis
Analysis Background
The world of programming with Python.
In these Analysis, have used the concepts i have learned to complete two Python challenges,
PyBank and PyPoll. Both tasks present a real-world situation where newly developed Python scripting skills come in handy.
Important
Key information users need to know to achieve their goal.
PyBank Instructions
In this Analysis, created a Python script to analyze the financial records of Banking company.
Financial dataset was given called budget_data.csv. The dataset Was composed of two columns: "Date" and "Profit/Losses".
Created 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
In addition, final script has both print the analysis to the terminal and export a text file with the results at Analysis folder.
PyPoll Instructions
In this Analysis, with helping a small, rural _town modernize_ its vote-counting process, a set of poll data was given called `election_data.csv`. The dataset was composed of three columns: "`Voter ID`", "`County`", and "`Candidate`". My task was to create a `Python` script that analyzes the votes and calculates each of the following values:- The total number of
votescast - A complete list of candidates who received votes
- The
percentageof votes each candidate won - The total number of
voteseach candidate won - The
winnerof theelectionbased on popular vote.
In addition, final script has both print the analysis to the terminal and export a text file with the results at Analysis folder.
Note
Useful information that users should know, even when skimming content.
Lesson learned
Considering what i have learned so far.
- how to import modules like csv.
- have learned how to read and write files in various formats.
- how to store content in variables lists, and dictionaries.
- learned how to iterate through basic data structures.
- learned how to debug along the way. Using all that i have learned, try to break down my tasks into discrete mini-objectives.
The datasets for these Challenges were quite large. This was done purposefully to showcase one of the limits of Excel-based analysis.
Tip
Helpful advice for doing things better or more easily.
In conclusion, As a data analysts; our first instinct is often to go straight to Excel, but creating scripts in Python can provide us with more powerful options for handling big data.
Note
Useful information that users should know, even when skimming content.
Repo Instructions
- Inside my local
Gitrepository, created a folder for each Analysis byPythonand name themPyBankandPyPoll.
In each folder, have created, added the following content:
- A new file called
main.py. This will be the main script to run for each analysis. - A
Resourcesfolder that contains theCSVfiles i have used. Assured that myscripthas the correct path to theCSVfile. - An
analysisfolder that contains text file that has the results from each analysis. - Pushed these changes to
GitHubprofile bybash terminal.







