Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- array1 = {[*unique ID's*, *date*, *number of hours*, *average output per hour*],
- ...}
- array1 = {[10213, 19660101, 720, 36.6],
- [10215, 19550102, 430, 25.5],
- [10215, 19550202, 255, 30.1],
- ...}
- unique_ID = np.unique(numpy_During[:, 0])
- print("starting creation of sub arrays")
- for x in np.nditer(unique_ID):
- temp = np.where(numpy_During[:, 0] == x)
- for value in np.nditer(temp):
- if str(int(x)) in list_of_ID:
- try:
- if max_Hours[str(int(x))] > 13140:
- break
- new_Array = np.empty([int(numpy_During[value, 2]), 6])
- new_Array[:, :] = numpy_During[value, :]
- old_Array = numps[str(int(x))]
- my_Stacker = (old_Array, new_Array)
- combined_Array = np.vstack(my_Stacker)
- numps[str(int(x))] = combined_Array
- max_Hours[str(int(x))] += numpy_During[value, 2]
- except:
- print("volume period of NaN")
- else:
- try:
- list_of_ID.append(str(int(x)))
- new_Array = np.empty([int(numpy_During[value, 2]), 6])
- new_Array[:, :] = numpy_During[value, :]
- numps[str(int(x))] = new_Array
- max_Hours[str(int(x))] = numpy_During[value, 2]
- except:
- print("volume period of NaN")
- panda['sum_calc'] = panda['per_hour'].rolling(window=size, center=False).sum()
- calc = panda.loc[panda['sum_calc'] == panda['sum_calc'].max(), 'sum_calc']
- calc_index = int(sum_calc._index.data[0]) # gets row number
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement