You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code below raises "ValueError: zero-size array to reduction operation maximum which has no identity", derive the problem and raise a clear error message.
importosimportpandasaspdimporthatyanimportkenmerkendewaardenaskw# set logging level to INFO to get log messagesimportlogginglogging.getLogger("kenmerkendewaarden").setLevel(level="INFO")
tstop_dt=pd.Timestamp(2021,1,1, tz="UTC+01:00")
dir_base=r'p:\11210325-005-kenmerkende-waarden\work'dir_meas=os.path.join(dir_base,'measurements_wl_18700101_20240101')
# TODO: move to full data folder (otherwise overschrijding and slotgemiddelde is completely wrong)# dir_meas = os.path.join(dir_base,'measurements_wl_20101201_20220201') # when using this, we get `TypeError: 'NoneType' object is not subscriptable`current_station='HANSWT'print("loading meas")
data_pd_meas_all=kw.read_measurements(dir_output=dir_meas, station=current_station, extremes=False)
data_pd_HWLW_all=kw.read_measurements(dir_output=dir_meas, station=current_station, extremes=True)
data_pd_HWLW_all_12=hatyan.calc_HWLW12345to12(data_pd_HWLW_all) #convert 12345 to 12 by taking minimum of 345 as 2 (laagste laagwater)print("slotgem")
# this worksslotgemiddelden_all=kw.calc_slotgemiddelden(df_meas=data_pd_meas_all.loc[:tstop_dt],
df_ext=data_pd_HWLW_all_12.loc[:tstop_dt],
min_coverage=0, clip_physical_break=True)
# this fails with `ValueError: zero-size array to reduction operation maximum which has no identity`slotgemiddelden_valid=kw.calc_slotgemiddelden(df_meas=data_pd_meas_all.loc[:tstop_dt],
df_ext=data_pd_HWLW_all_12.loc[:tstop_dt],
min_coverage=1, clip_physical_break=True)
The error occurred since too much yearly averages were incorrectly seen as invalid with a min_coverage of 100%, this will be picked up in a follow-up issue: #88
The text was updated successfully, but these errors were encountered:
The code below raises
"ValueError: zero-size array to reduction operation maximum which has no identity"
, derive the problem and raise a clear error message.The error occurred since too much yearly averages were incorrectly seen as invalid with a min_coverage of 100%, this will be picked up in a follow-up issue: #88
The text was updated successfully, but these errors were encountered: