AttributeError: 'float' object has no attribute 'shape' when calibration #94
ylbestwishes
started this conversation in
General
Replies: 1 comment
-
Hi ylbestwishes, Please provide a sample of your observed discharge data and formating (maybe a screenshot). Best |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
C:\Users\LENOVO\Documents\GitHub\CWatM\Toolkit\Calibration\scripts\Cali_plot.py:166: UserWarning: Could not infer format, so each element will be parsed individually, falling back to
dateutil
. To ensure parsing is consistent and as-expected, please specify a format.Qsim1 = pandas.read_csv(os.path.join(path_subcatch,loadsim), sep=",", parse_dates=True, index_col=0, header=None)
Traceback (most recent call last):
File "C:\Users\LENOVO\Documents\GitHub\CWatM\Toolkit\Calibration\scripts\Cali_plot.py", line 234, in
+"KGE="+"{0:.2f}".format(hydroStats.KGE(s=Q_sim_Cal, o=Q_obs_Cal, warmup=WarmupDays))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\LENOVO\Documents\GitHub\CWatM\Toolkit\Calibration\scripts\hydroStats.py", line 347, in KGE
r = np.corrcoef(o, s)[0,1]
^^^^^^^^^^^^^^^^^
File "C:\Users\LENOVO.virtualenvs\CWATM\Lib\site-packages\numpy\lib\function_base.py", line 2889, in corrcoef
c = cov(x, y, rowvar, dtype=dtype)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\LENOVO.virtualenvs\CWATM\Lib\site-packages\numpy\lib\function_base.py", line 2724, in cov
avg, w_sum = average(X, axis=1, weights=w, returned=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\LENOVO.virtualenvs\CWATM\Lib\site-packages\numpy\lib\function_base.py", line 557, in average
if scl.shape != avg_as_array.shape:
^^^^^^^^^
AttributeError: 'float' object has no attribute 'shape'
I am sure that the observed data and simulated data have the same length. And I have tried to add some code to convert the observed data and simulated data into numpy. However, this doesn't work. I am enquiring that whether you can give me some suggestions. Thanks so much !
Beta Was this translation helpful? Give feedback.
All reactions