Skip to content
Advertisement

Tag: scipy

ImportError: No module named scipy

I am using Python 2.7 and trying to get PyBrain to work. But I get this error even though scipy is installed – I have installed scipy using this command – I get – What should I do? Answer Try to install it as a python package using pip. You said you already tried: Now run: I ran both and

Python lmfit – how to calculate R squared?

This may be a stupid question, but I didn’t find an answer to it anywhere in lmfit’s documentation. My question is simple: how do I retrieve R squared? (I know I can calculate it manually with 1 – SS_res / SS_tot) Update: I tried calculating R squared myself and compared it to the R squared from statsmodels. Parameters are the

unexpected result in numpy array slicing (view vs copy)

I’m trying to reduce the amount of copying in my code and I came across surprising behavior when dealing with numpy array slicing and views, as explained in: Scipy wiki page on copying numpy arrays I’ve stumbled across the following behavior, which is unexpected for me: Case 1.: As expected, this outputs: Case 2: When performing the slicing and addition

How to perform two-sample one-tailed t-test with numpy/scipy

In R, it is possible to perform two-sample one-tailed t-test simply by using In Python world, scipy provides similar function ttest_ind, but which can only do two-tailed t-tests. Closest information on the topic I found is this link, but it seems to be rather a discussion of the policy of implementing one-tailed vs two-tailed in scipy. Therefore, my question is

T-test in Pandas

If I want to calculate the mean of two categories in Pandas, I can do it like this: I have a lot of data formatted this way, and now I need to do a T-test to see if the mean of cat1 and cat2 are statistically different. How can I do that? Answer it depends what sort of t-test you

Difference between Levenberg-Marquardt-Algorithm and ODR

I was able to fit curves to a x/y dataset using peak-o-mat, as shown below. Thats a linear background and 10 lorentzian curves. Since I need to fit many similar curves I wrote a scripted fitting routine, using mpfit.py, which is a Levenberg-Marquardt-Algorithm. However the fit takes longer and, in my opinion, is less accurate than the peak-o-mat result: Starting

Recommendations for Low Discrepancy (e.g. Sobol) quasi-random sequences in Python/SciPy?

I would like to use a quasi-random sequence, specifically Sobol, within a SciPy based simulation. Any recommendations on existing, efficient packages? Answer I would use OpenTURNS, which provides several low discrepancy sequences: Faure sequence, Halton sequence, Reverse Halton sequence, Haselgrove sequence, Sobol sequence. Moreover, the sequence can be generated so that the marginals have arbitrary distribution. This is done with

Advertisement