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
Tag: scipy
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
How to implement band-pass Butterworth filter with Scipy.signal.butter
UPDATE: I found a Scipy Recipe based in this question! So, for anyone interested, go straight to: Contents » Signal processing » Butterworth Bandpass I’m having a hard time to achieve what seemed initially a simple task of implementing a Butterworth band-pass filter for 1-D numpy array (time-series). The parameters I have to include are the sample_rate, cutoff frequencies IN
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
Efficiently accumulating a collection of sparse scipy matrices
I’ve got a collection of O(N) NxN scipy.sparse.csr_matrix, and each sparse matrix has on the order of N elements set. I want to add all these matrices together to get a regular NxN numpy array. (N is on the order of 1000). The arrangement of non-zero elements within the matrices is such that the resulting sum certainly isn’t sparse (virtually
Indexing with boolean arrays into multidimensional arrays using numpy
I am new to using numpy and one thing that I really don’t understand is indexing arrays. In the tentative tutorial there is this example: I have no idea why it does that last thing. Can anyone explain that to me? Thanks! Answer Your array consists of: One way of indexing it would be using a list of integers, specifying
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