SAFEtoolbox / SAFE-python

Sensitivity Analysis library for python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Index 1 is out of bounds for axis 1 with size 1.

iamtekson opened this issue · comments

I tried to run the aggregate_boot() function but got following error,

---> 25 mi_m, mi_lb, mi_ub = aggregate_boot(mi) # shape (M,)
     26 sigma_m, sigma_lb, sigma_ub = aggregate_boot(sigma) # shape (M,)
     27 

/opt/conda/lib/python3.9/site-packages/safepython/util.py in aggregate_boot(S, alfa)
    328 
    329         S_m[j, :] = np.nanmean(S[j], axis=0) # bootstrap mean
--> 330         idx = ~np.isnan(S[j][:, 1])
    331         if np.sum(idx) < Nboot:
    332             warn('Statistics were computed using ' + '%d' % (np.sum(idx))+

IndexError: index 1 is out of bounds for axis 1 with size 1

I think the possible solution might be changing the index value to 0 instead of 1. I was trying to run the function for the M shape as (1000,1)