Пример #1
0
 def __init__(self, yearInt, cleanFileStr):
     self.dataYear = yearInt
     self.cleanFileName = cleanFileStr
     self.employeeMasterList = open_cleanfile(self.cleanFileName)  #  list of e_list
     self.uniquePositions = count_positions(self.employeeMasterList, "d")  # uniquePositions is sorted from highest f; list of tuples
     #simple stats per year
     self.uniquePositionsCount = len(self.uniquePositions)
     self.totalSalary = sumSalary(self.employeeMasterList)
Пример #2
0
__author__ = 'alanchu'
#  This python file will call multiple functions that I am working on, and
#  test to see that they are working.  This file will also be a sort of coding playground

################# IMPORT #######################
from open_cleanfile import open_cleanfile  # imports open_cleanfile function
from count_positions import count_positions  # imports open_cleanfile function
from decimal import Decimal
import pprint
import operator

################# TESTING GROUND ##############
clean_employee_list = open_cleanfile("uvmSalary15.csv")
sorted_position_list = count_positions(clean_employee_list, "d")  #returns a list of tuples!!

# pprint.pprint(sorted_position_list[1])

# # sort the clean_employee_list by position?
# sorted_employee_list = sorted(clean_employee_list, key=operator.itemgetter(1), reverse=True)
# pprint.pprint(sorted_position_list)

position_salary_distribution_list = []
for i in range(2): #  gets first 10 positions from sorted_position_list[]
    temp_array = []
    # DEBUGGING & DATA TYPE
    # print type(sorted_position_list[i][0]) # str
    # print type(sorted_position_list[i][1]) # int
    # break

    temp_array.append(sorted_position_list[i][0])  # appends the position
    temp_array.append(sorted_position_list[i][1])  # appends the count of that position