Open dragonburn1991 opened 3 years ago
It seems you are using the pip version of the code. Please use the latest code on github. Pip code has a few issues which have been resolved. However, I have not pushed the latest version to pip as the normal correction for multi-dimensional data is still not working. Will push the code to pip once this issue is resolved.
Thanks
Hello I would like to test the following command for only one station Could I use an excel file for the model, and data_to_be_corrected? and also for reference? and what are the format of this excel file bc = BiasCorrection(reference, model, data_to_be_corrected)
You could have a single excel file for model, reference and data_to_be_corrected or separate files for all these three. However, model and reference should have some overlap time period. In short, model and reference are datasets which you use to find bias and then this bias is used to correct the data_to_be_corrected.
Take a look at the attached image for an example.
Thanks for your answer Could you please send me a sample for the following: MODEL_HISTORIQUE.txt; OBSERVED.txt; Model.txt; To prepare my files to be like them. All the best and Thank you in advance Mohamed
Thank you for your prompt answer.
Please find the attached script that I used to bias-corrected the data that you send to me.
I get one simple error
ax.legand () Traceback (most recent call last): File "
", line 1, in AttributeError: 'AxesSubplot' object has no attribute 'legand'
and I get this error also, could you tell me how to fix it. bc = BiasCorrection(ref, mod, sce)
corrected = bc.correct(method='gamma_mapping') Traceback (most recent call last): File "
", line 1, in File "C:\Python36-32\lib\site-packages\bias_correction.py", line 133, in correct cdf_threshold=cdf_threshold) File "C:\Python36-32\lib\site-packages\bias_correction.py", line 35, in gamma_correction obs_gamma, mod_gamma, sce_gamma = [gamma.fit(x) for x in [obs_raindays, mod_raindays, sce_raindays]] File "C:\Python36-32\lib\site-packages\bias_correction.py", line 35, in obs_gamma, mod_gamma, sce_gamma = [gamma.fit(x) for x in [obs_raindays, mod_raindays, sce_raindays]] File "C:\Python36-32\lib\site-packages\scipy\stats_continuous_distns.py", line 2860, in fit return super(gamma_gen, self).fit(data, *args, **kwds) File "C:\Python36-32\lib\site-packages\scipy\stats_distn_infrastructure.py", line 2302, in fit if not np.isfinite(data).all(): File "C:\Python36-32\lib\site-packages\pandas\core\generic.py", line 1330, in nonzero f"The truth value of a {type(self).name} is ambiguous. " ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
Thank you for your prompt answer.
Please find the attached script that I used to bias-corrected the data that you send to me.
I get one simple error
ax.legand () Traceback (most recent call last): File "", line 1, in AttributeError: 'AxesSubplot' object has no attribute 'legand'
and I get this error also, could you tell me how to fix it. bc = BiasCorrection(ref, mod, sce)
corrected = bc.correct(method='gamma_mapping') Traceback (most recent call last): File "", line 1, in File "C:\Python36-32\lib\site-packages\bias_correction.py", line 133, in correct cdf_threshold=cdf_threshold) File "C:\Python36-32\lib\site-packages\bias_correction.py", line 35, in gamma_correction obs_gamma, mod_gamma, sce_gamma = [gamma.fit(x) for x in [obs_raindays, mod_raindays, sce_raindays]] File "C:\Python36-32\lib\site-packages\bias_correction.py", line 35, in obs_gamma, mod_gamma, sce_gamma = [gamma.fit(x) for x in [obs_raindays, mod_raindays, sce_raindays]] File "C:\Python36-32\lib\site-packages\scipy\stats_continuous_distns.py", line 2860, in fit return super(gamma_gen, self).fit(data, *args, kwds) File "C:\Python36-32\lib\site-packages\scipy\stats_distn_infrastructure.py", line 2302, in fit if not np.isfinite(data).all(): File "C:\Python36-32\lib\site-packages\pandas\core\generic.py", line 1330, in nonzero f"The truth value of a {type(self).name**} is ambiguous. " ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
Are you mean ax.legend()?
Yes this is one error about ax.legend() and ther are another error related to ; corrected = bc.correct(method='gamma_mapping')
Hello, Thank you for sharing your bias correction programs
I am following the example from https://github.com/pankajkarman/bias_correction/blob/master/example.ipynb. However, when I get some error when I try to bias correction by using this command: df2 = bc.correct(method='basic_quantile').
The error as followed: ValueError Traceback (most recent call last)