Skip to content

MohammedRizwan-1/Python-Scripting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

Python-Scripting

Creating a Python script to analyse financial records contained in a CSV file.

PyBank and PyPoll homework challenge

PyBank Using the os and csv functions the code imports the budget data csv. It pulls the headers out of the csv file and then creates a list of the dates and profit figures. The profit figures are then converted into numbers. The code loops through the lists, subtracting each profit value from the preceding month and storing it in a list. These figures are then averaged, and the maximum/minimum values are found. These are then printed in the terminal and outputted to a txt file in the analysis folder.

PyPoll Using the os and csv functions the code imports the election data csv. The code then pulls out the headers and loops through the required columns to create lists. The length of the list determines the number of votes. The code then loops through the lists to find the unique candidate names and the count function tallies up the number of votes. These are then converted into percentages and rounded to three decimal places The max function is used to pull out the winner’s name. These are then printed in the terminal and outputted to a txt file in the analysis folder.

Results

I believe I sucessfully completed the objective. Both files create the required output and print that output to a text file in the analysis folder.

Reflections

Using what I learned, I was able to complete the PyPoll challenge with little help.

I had more difficulty with the PyPoll challenge, and I wasn't completely satisfied with the result. I utilised feedback from previous task I received by including more comments in my script exlplaining what I was doing and what the variables were for. I enjoyed working on this challenge very much, and I learned a great deal.

About

Creating a Python script to analyse financial records contained in a CSV file.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages