-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestGit.py
47 lines (42 loc) · 1.67 KB
/
testGit.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import pandas as pd
import numpy as np
##from git import Repo,remote
##
##
##def gitPull(gitHubLoc,repotCheckout):
## repoLocal = Repo(repotCheckout)
## origin = repo.remote(name='origin')
## origin.fetch()
## print(origin.refs[0])
## #origin.pull(origin.refs[0].remote_head)
##
##gitHubLoc = '[email protected]:tiger-syntex/TimeSheet.git'
##repotCheckout = 'H:\Repos\MohitYadavGitHub\TimeSheetV2\TimeSheet'
##gitPull(gitHubLoc,repotCheckout)
##
def flattenMixList(inputList):
final = []
for i in inputList:
if type(i) == list or type(i)== np.ndarray:
for j in i:
final.append(j)
else:
final.append(i)
return(final)
empDataBase = 'employeeList.csv'
salarayDatabase = 'salaryDatabase.csv'
empListSheet = 'EmployeesList'
monthlyDataSheet = 'MonthlyData'
excelForDisp = 'displayData_test.xlsx'
gitHubLoc = '[email protected]:tiger-syntex/TimeSheet.git'
repotCheckout = 'H:\Repos\MohitYadavGitHub\TimeSheetV2\TimeSheet'
currMonth = 'October 2017'
colIndex = flattenMixList (['MonthlySalary',
[str(x) for x in list(range(1,32))],
'Total_Days_Worked',
'Advance_Balance',
'Advance_For_Month',
'Salary_For_Month'])
salDataFromExcelForMonth = pd.read_excel(excelForDisp,currMonth,index_col=[0])
rowMultiIndices = pd.MultiIndex.from_product([salDataFromExcelForMonth.index.values,[currMonth]],names=['EmployeeName','Month'])
newDFtoadd = pd.DataFrame (salDataFromExcelForMonth.values,index=rowMultiIndices,columns=colIndex)