Improving FFT performance in Python

You could certainly wrap whatever FFT implementation that you wanted to test using Cython or other like-minded tools that allow you to access external libraries. GPU-based If you’re going to test FFT implementations, you might also take a look at GPU-based codes (if you have access to the proper hardware). There are several: reikna.fft, scikits.cuda. … Read more

sigmoidal regression with scipy, numpy, python, etc

Using scipy.optimize.leastsq: import numpy as np import matplotlib.pyplot as plt import scipy.optimize def sigmoid(p,x): x0,y0,c,k=p y = c / (1 + np.exp(-k*(x-x0))) + y0 return y def residuals(p,x,y): return y – sigmoid(p,x) def resize(arr,lower=0.0,upper=1.0): arr=arr.copy() if lower>upper: lower,upper=upper,lower arr -= arr.min() arr *= (upper-lower)/arr.max() arr += lower return arr # raw data x = np.array([821,576,473,377,326],dtype=”float”) … Read more

Multivariate spline interpolation in python/scipy?

If I’m understanding your question correctly, your input “observation” data is regularly gridded? If so, scipy.ndimage.map_coordinates does exactly what you want. It’s a bit hard to understand at first pass, but essentially, you just feed it a sequence of coordinates that you want to interpolate the values of the grid at in pixel/voxel/n-dimensional-index coordinates. As … Read more

Speedup scipy griddata for multiple interpolations between two irregular grids

There are several things going on every time you make a call to scipy.interpolate.griddata: First, a call to sp.spatial.qhull.Delaunay is made to triangulate the irregular grid coordinates. Then, for each point in the new grid, the triangulation is searched to find in which triangle (actually, in which simplex, which in your 3D case will be … Read more

Installing NumPy and SciPy on 64-bit Windows (with Pip)

You can install scipy and numpy using their wheels. First install wheel package if it’s already not there… pip install wheel Just select the package you want from http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy Example: if you’re running python3.5 32 bit on Windows choose scipy-0.18.1-cp35-cp35m-win_amd64.whl then it will automatically download. Then go to the command line and change the directory … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)