Пример #1
0
dict_sequence_less_than_five_year = c.init_dict_sequence(col_of_companySequence=dimission_form['col_of_companySequence'])
#综合流失人数
dict_sequence_comprehensive_attrition = c.init_dict_sequence(col_of_companySequence=dimission_form['col_of_companySequence'])
for i in c:
    c.calc_less_than_one_month(i,col_of_workYears=dimission_form['col_of_workYears'],col_of_companySequence=dimission_form['col_of_companySequence'],dict_sequence=dict_sequence_less_than_one_month)
    c.calc_less_than_three_month(i,col_of_workYears=dimission_form['col_of_workYears'],col_of_companySequence=dimission_form['col_of_companySequence'],dict_sequence=dict_sequence_less_than_three_month)
    c.calc_less_than_three_month(i,col_of_workYears=dimission_form['col_of_workYears'],col_of_companySequence=dimission_form['col_of_companySequence'],dict_sequence=dict_sequence_less_than_six_month)
    c.calc_less_than_one_year(i,col_of_workYears=dimission_form['col_of_workYears'],col_of_companySequence=dimission_form['col_of_companySequence'],dict_sequence=dict_sequence_less_than_one_year)
    c.calc_less_than_two_year(i,col_of_workYears=dimission_form['col_of_workYears'],col_of_companySequence=dimission_form['col_of_companySequence'],dict_sequence=dict_sequence_less_than_two_year)
    c.calc_less_than_three_year(i,col_of_workYears=dimission_form['col_of_workYears'],col_of_companySequence=dimission_form['col_of_companySequence'],dict_sequence=dict_sequence_less_than_three_year)
    c.calc_less_than_four_year(i,col_of_workYears=dimission_form['col_of_workYears'],col_of_companySequence=dimission_form['col_of_companySequence'],dict_sequence=dict_sequence_less_than_four_year)
    c.calc_less_than_five_year(i,col_of_workYear=dimission_form['col_of_workYears'],col_of_companySequence=dimission_form['col_of_companySequence'],dict_sequence=dict_sequence_less_than_five_year)
    c.comprehensive_attrition(i,col_of_companySequence=dimission_form['col_of_companySequence'],dict_sequence=dict_sequence_comprehensive_attrition)
###############################################################################

t = BaseExcelWriter()
t.add_sheet_name(u'非C非实习员工流失率')
t.write_sheet_companySequence(companySequence)
write_value(companySequence=companySequence,dict_sequence=dict_sequence_new_not_C_not_intern,dict_sequence_name=u'新进非C非实习人数',col_of_value=COL['B'],base_excel_writer=t)
write_value(companySequence=companySequence,dict_sequence=dict_sequence_voluntary_resign,dict_sequence_name=u'主动离职人数',col_of_value=COL['C'],base_excel_writer=t)
write_value(companySequence=companySequence,dict_sequence=dict_sequence_phased_out,dict_sequence_name=u'淘汰人数',col_of_value=COL['D'],base_excel_writer=t)
write_value(companySequence=companySequence,dict_sequence=dict_sequence_decline,dict_sequence_name=u'辞退人数',col_of_value=COL['E'],base_excel_writer=t)

t.add_sheet_name(u'非实习员工流失率')
t.write_sheet_companySequence(companySequence)
write_value(companySequence=companySequence,dict_sequence=dict_sequence_not_intern,dict_sequence_name=u'非实习员工流失人数',col_of_value=COL['B'],base_excel_writer=t)

t.add_sheet_name(u'C员工流失率')
t.write_sheet_companySequence(companySequence)
write_value(companySequence=companySequence,dict_sequence=dict_sequence_end_of_month_C,dict_sequence_name=u'月末C人数',col_of_value=COL['B'],base_excel_writer=t)
write_value(companySequence=companySequence,dict_sequence=dict_sequence_new_C,dict_sequence_name=u'新进C人数',col_of_value=COL['C'],base_excel_writer=t)
Пример #2
0
#!/usr/bin/env python
# encoding: utf-8

from DismissionData import DismissionRateSummary
from Base import BaseExcelWriter
from DismissionData import write_value

c = DismissionRateSummary('201603区域离职数据.xlsx')
#序列
companySequence = c.unduplicate_sequence()

#需要写入的数据,格式--序列:[0,0,0,0,0]
#五位数字分别为:新员工离职人数,老员工离职人数,主动离职人数,淘汰人数,辞退人数
dict_sequence = c.calc_each_sheet()

t = BaseExcelWriter()
t.add_sheet_name(u'离职率汇总情况')
t.write_sheet_companySequence(companySequence,need_encode=False)
write_value(companySequence,dict_sequence,t,B=u'新员工离职人数',C=u'老员工离职人数',D=u'主动离职人数',E=u'淘汰人数',F=u'辞退人数')

t.save_file('test_dismission_data.xls')