项目作者: keithhorbin

项目描述 :
Python analysis of financial records, voting records, employee database.
高级语言: Python
项目地址: git://github.com/keithhorbin/Employee-Financial-Voting-Analysis.git


Python Challenges

PyBank

  • In this challenge, you are tasked with creating a Python script for analyzing the financial records of your company. You will give a set of financial data called budget_data.csv. The dataset is composed of two columns: Date and Profit/Losses. (Thankfully, your company has rather lax standards for accounting so the records are simple.)
  • Your task is to create a Python script that analyzes the records to calculate each of the following:
    o The total number of months included in the dataset
    o The net total amount of “Profit/Losses” over the entire period
    o The average of the changes in “Profit/Losses” over the entire period
    o The greatest increase in profits (date and amount) over the entire period
    o The greatest decrease in losses (date and amount) over the entire period

PyPoll

  • In this challenge, you are tasked with helping a small, rural town modernize its vote-counting process. (Up until now, Uncle Cleetus had been trustfully tallying them one-by-one, but unfortunately, his concentration isn’t what it used to be.)
  • You will be give a set of poll data called election_data.csv. The dataset is composed of three columns: Voter ID, County, and Candidate. Your task is to create a Python script that analyzes the votes and calculates each of the following:
    o The total number of votes cast
    o A complete list of candidates who received votes
    o The percentage of votes each candidate won
    o The total number of votes each candidate won
    o The winner of the election based on popular vote.

  • In addition, your final script should both print the analysis to the terminal and export a text file with the results.

PyBoss

In this challenge, you get to be the boss. You oversee hundreds of employees across the country developing Tuna 2.0, a world-changing snack food based on canned tuna fish. Alas, being the boss isn’t all fun, games, and self-adulation. The company recently decided to purchase a new HR system, and unfortunately for you, the new system requires employee records be stored completely differently.

Your task is to help bridge the gap by creating a Python script able to convert your employee records to the required format. Your script will need to do the following:

  • Import the employee_data.csv file, which currently holds employee records like the below:
  1. Emp ID,Name,DOB,SSN,State
  2. 214,Sarah Simpson,1985-12-04,282-01-8166,Florida
  3. 15,Samantha Lara,1993-09-08,848-80-7526,Colorado
  4. 411,Stacy Charles,1957-12-20,658-75-8526,Pennsylvania
  • Then convert and export the data to use the following format instead:
  1. Emp ID,First Name,Last Name,DOB,SSN,State
  2. 214,Sarah,Simpson,12/04/1985,***-**-8166,FL
  3. 15,Samantha,Lara,09/08/1993,***-**-7526,CO
  4. 411,Stacy,Charles,12/20/1957,***-**-8526,PA
  • In summary, the required conversions are as follows:

    • The Name column should be split into separate First Name and Last Name columns.

    • The DOB data should be re-written into MM/DD/YYYY format.

    • The SSN data should be re-written such that the first five numbers are hidden from view.

    • The State data should be re-written as simple two-letter abbreviations.