0
votes
0answers
14 views

Scipy minimize, fmin, leastsq type problems (setting array element with sequence)

I'm having trouble with the scipy.optimize.fmin and scipy.optimize.minimize functions. I've checked and confirmed that all the arguments passed to the function are of type numpy.array, as well as the ...
0
votes
1answer
25 views

Term document matrix and cosine similarity in Python

I have following situation that I want to address using Python (preferably using numpy and scipy): Collection of documents that I want to convert to a sparse term document matrix. Extract sparse ...
0
votes
0answers
6 views

SciPy test failure on MacOS Mountain Lion using pip/virtualenv and XCode 4.6.3

I've had a problem running a mass spectrometry code, called nsilk, which has NumPy, SciPy and BioPython as dependencies. Since I run other Python-based projects on my Mac (Mountain Lion), I wanted to ...
1
vote
1answer
23 views

Extract non-main diagonal from scipy sparse matrix?

Say that I have a sparse matrix in scipy.sparse format. How can I extract a diagonal other than than the main diagonal? For a numpy array, you can use numpy.diag. Is there a scipy sparse ...
1
vote
1answer
49 views

Dictionaries containing the biggest values

I have this scipy csr_matrix: (0, 12114) 0.272571581001 (0, 12001) 0.0598986479579 (0, 11998) 0.137415042369 (0, 11132) 0.0681428952502 (0, 10412) 0.0681428952502 (1, 10096) ...
2
votes
1answer
19 views

Sum of the elements in a CSR matrix

I would like to find a way to manipulate a scipy.sparse.csr_matrix in order to obtain the sum of its elements based on the column..For example, if I have this: (2, 883) 0.0194935608679 (10, 883) ...
0
votes
0answers
24 views

Clustering with Scipy in Python? (hierarchical clustering)

I'm a bit confused about the clusering with Scipy in Python. Here is my sourcecode: import scipy.spatial.distance as dist import numpy, scipy dataMatrix = numpy.array(matrix) distMatrix = ...
8
votes
1answer
99 views

Numpy: Difference between dot(a,b) and (a*b).sum()

For 1-D numpy arrays, this two expressions should yield the same result (theorically): (a*b).sum()/a.sum() dot(a, b)/a.sum() The latter uses dot() and is faster. But which one is more accurate? ...
1
vote
2answers
76 views

Combining two Gaussians into another Guassian [on hold]

In the code below I have two Gaussian one red and the other in a purple curve. I am wondering if there is a way in python to combining both Gaussian unto a third curve which is suppose to look like ...
2
votes
1answer
17 views

MemoryError in Python while using cKDTree().query_ball_tree

I have large 2D arrays with unsorted (X,Y) points, for which I need to know which points are in close proximity to each other (nearest-neighbor lookup). I have used cKDTree and query_ball_tree with ...
4
votes
2answers
64 views

Is there a python equivalent of R's qchisq function?

The R qchisq function converts a p-value and number of degrees of freedom to the corresponding chi-squared value. Is there a Python library that has an equivalent? I've looked around in SciPy ...
0
votes
1answer
20 views

imread is not found in misc module

I am trying to use misc.imsave('lena.png', l) and it always tells me that imsave is not found. I read and search for answers and still no clue. I imported both scipy and PIL module. >>> ...
1
vote
3answers
58 views

Failure of non linear fit to sine curve

I've been trying to fit the amplitude, frequency and phase of a sine curve given some generated two dimensional toy data. (Code at the end) To get estimates for the three parameters, I first perform ...
2
votes
1answer
31 views

AttributeError: 'module' object (scipy) has no attribute *** Why does this error occur?

In scipy, the error occurs quite often. >>> import scipy >>> scipy.integrate.trapz(gyroSeries, timeSeries) Traceback (most recent call last): File "<stdin>", line 1, in ...
1
vote
0answers
39 views

with SciPy, how to generate waveforms given the pulse shape?

With Python/Scipy, if I have a simply signal sequence [1, -1, -1, 1, ...], how can I generate a real-valued baseband waveforms with oversampling rate m, and common pulse shapes such as root raised ...

1 2 3 4 5 132
15 30 50 per page