Skip to content
Advertisement

Tag: scipy

Pulling x-values of spline integer y-values?

I have the given sample data and interpolated spline: I would like to pull the x values that correspond to the integer y values of the spline, but am not sure how to do this. I assume I will be using np.where() and have tried (to no avail): Answer You could use the find_roots function from this post to find

How to hide `delta_grad == 0.0` warning in scipy.optimize.minimize?

I have a loop that executes several hundred optimizations using scipy.optimize.minimize. Unfortunately, I keep getting this annoying warning: Because I am running hundreds of optimizations, this warning shows up dozens and dozens of times during the loop, and it just clutters the console and obscures the rest of my program’s output. Is there a way to either Check if this

stats.ttest_ind() vs. “manual” computation of Student’s independent t-test: different results

I am comparing stats.ttest_ind() vs “manual” computation of the same test, and get different results. stats.ttest_ind() method: Out: Manual method: Out: We can see there’s a small difference. Why? Maybe because of how stats.ttest_ind() computes degrees of freedom? Any insight much appreciated. Answer The following works. It is your code from above, with only two rows changed. and it outputs

Eucledian distance to point source

I am stimulating a model via a point source, which is located above (z-direction)– to be able to compute the impact of the stimulation i need to compute the eucledian distance from this point power source to each mid of compartment (see picute). I tried it this way, but the results are strange — maybe the computation of the distance

Weibull: R vs Python – slightly different results

I’m trying to replicate R’s fitdist() results (reference, cannot modify R code) in Python using scipy.stats. The results are quite close but still different (difference is at not acceptable level). Does anybody know why the results are different? How can I reduce the difference between the results? scipy_stats.weibull_min definition (https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.weibull_min.html) seems to be the same as R’s weibull (https://stat.ethz.ch/R-manual/R-devel/library/stats/html/Weibull.html. Data

Advertisement