I have searched through the other posts similar to this one to no avail. I have uninstalled scipy, updated conda, and re-installed scipy. At first I think I had upgraded it with pip accidentally so I removed all that and reinstalled with conda. I am still getting this error. I have done the same think in a google cloud data proc to narrow down whether the error is coming from something about my setup but I am getting the same error. Here is the function I was trying to run:
def get_ci(value, cl, sd):
loc = scs.stats.norm.ppf(1 - cl/2)
rng_val = sci.norm.cdf(loc - value/sd)
lwr_bnd = value - rng_val
upr_bnd = value + rng_val
return_val = (lwr_bnd, upr_bnd)
return(return_val)
I have tried different import statements too- including:
import scipy
from scipy import stats
import scipy as scs
from scipy import norm
from scipy.stats import norm
Thanks in advance.
Also, if you have any constructive criticism about my post I would appreciate that as well. This is my first post.
Well, the function you posted uses the name sci
which is not defined in any of your import statements. Try running this in a fresh kernel.
from scipy.stats import norm
def get_ci(value, cl, sd):
loc = norm.ppf(1 - cl/2)
rng_val = norm.cdf(loc - value/sd)
lwr_bnd = value - rng_val
upr_bnd = value + rng_val
return_val = (lwr_bnd, upr_bnd)
return(return_val)
By the way, you should generally post an exact example of your code so we can run it ourselves. Since your problem is with import statements, it would include the exact import statements combined with the code. Were you actually using all five of those import statements at once and then trying to define your function?
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments