Skip to content

Two python challenges that imports csv files into python and does calculations before printing out the results.

Notifications You must be signed in to change notification settings

jonhicks123/python-challenge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

python-challenge

(PyBank)

For this challenge I created a Python script that analyzes the records in the budget_data.csv file to calculate each of the following:

  • 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, as well as the average of those changes.

  • The greatest increase in profits over the entire period, including the date and the amount.

  • The greatest decrease in losses over the entire period, including the date and the amount.

(PyPoll)

As for this challenge, I created a Python script that analyzes the votes, county, and candidates in the election_data.csv to calculate each of the following:

  • The total number of votes that were cast.

  • The percentage of votes that each candidate won.

  • The total number of votes each candidate won (within the same line as the percentage).

  • The winner of the election based on popular vote.

For both challenges, their scripts print the results into the terminal, as well as a separate .txt file which are placed into the analysis folder in the directory of each challenge.

To run the script and yield the results:

  • Download the repository and extract the python-challenge zip to the location of your choice

  • Open up Visual Studio Code or Spyder and cd into the directory where you extracted this repository.

  • For PyBank, cd into python-challenge, then cd into PyBank directory. For PyPoll, cd into python-challenge, then cd into PyPoll directory.

  • Lastly, run the code and check out the results!

About

Two python challenges that imports csv files into python and does calculations before printing out the results.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages