I have data for 12 instruments grouped as 3x4 (4 instruments for each group: N1, N2, N3, N4; C1, C2, C3, C4; S1, S2, S3, S4;). Each instrument has 2 sets of data: H and T. The dataset comes from different excel spreadsheets.
What is the best way to perform this interaction? Creating a dictionary, a matrix, using the lists...? In Matlab I would create 3 matrices with 4 columns each, but I don't know how to do this on Python (just started using it).
First I am trying to create the variables described above (N1, C3, S4...) and appending the values from different excel spreadsheets:
sheets = ['S_WH', 'C_WH', 'N_WH']
for i in sheets:
path = r"\\uniwa.uwa.edu.au\userhome\students2\22371812\My Documents\Documents\FieldTechniques"
filename = i + '.xlsx'
sheetHeights = openpyxl.load_workbook(os.path.join(path,filename), data_only=True)
heights = sheetHeights.get_sheet_by_name("Sheet1")
Time=[]
H1=[]
H2=[]
H3=[]
H4=[]
for row in range (2, heights.max_row+1):
Time.append(heights['A' + str(row)].value)
H1.append(heights['B' + str(row)].value)
H2.append(heights['C' + str(row)].value)
H3.append(heights['D' + str(row)].value)
H4.append(heights['E' + str(row)].value)
First of all, how do I get those lists (H1, H2...) and append to a dictionary (that's how I thought it could be the best way) for each one of the sheets?
Secondly, I have to do the same for T values, so all the stations will have H and T related to it. A third value would be S, that is the sum of H and T. I don't know how to do this either. If someone could help me (even giving some hints) it would be great.