NumPy is a scientific and numerical computing extension to the Python programming language.

learn more… | top users | synonyms

5
votes
0answers
94 views

numpy distutils — Try to compile something and set flags if you fail

One common way to build source code on *NIX platforms is to use a configure script. Under the hood, configure tries to build a bunch of test programs to determine which libraries you have accessible. ...
4
votes
0answers
93 views

GLXBad Drawable error

When i run a python script ...... I get this error after installing all dependencies.... "The program 'python2' received an X Window System error." What are the possibilities? Link to the python ...
3
votes
0answers
53 views

ZeroDivisionError when using scipy.interpolate.griddata

I'm getting a ZeroDivisionError from the following code: #stacking the array into a complex array allows np.unique to choose #truely unique points. We also keep a handle on the unique indices #to ...
3
votes
0answers
74 views

Numpy: apparent memory error

Using Python/Numpy, I'm trying to import a file; however, the script returns an error that I believe is a memory error: In [1]: import numpy as np In [2]: npzfile = np.load('cuda400x400x2000.npz') ...
3
votes
0answers
70 views

Multidimensional Scaling Fitting in Numpy, Pandas and Sklearn (ValueError)

I'm trying out multidimensional scaling with sklean, pandas and numpy. The data file Im using has 10 numerical columns and no missing values. I am trying to take this ten dimensional data and ...
3
votes
0answers
34 views

vectorize a function operated on subarray of a ndarray

I have a function acted on each 2D slices of a 3D array. How to vectorize the function to avoid loop to improve the performace? For example: def interp_2d(x0,y0,z0,x1,y1): # x0, y0 and z0 are 2D ...
3
votes
0answers
56 views

Is there any documentation of numpy numerical stability?

I looked around for some documentation of how numpy/scipy functions behave in terms of numerical stability, e.g. are any means taken to improve numerical stability or are there alternative stable ...
3
votes
0answers
60 views

numpy inserting axis makes data non-contiguous

Why does inserting a new axis make the data non-contiguous? >>> a = np.arange(12).reshape(3,4,order='F') >>> a array([[ 0, 3, 6, 9], [ 1, 4, 7, 10], [ 2, 5, 8, ...
3
votes
0answers
121 views

Optimising boost::python::object instances

I recently started using Boost's Python library to wrap parts of a rather large C++ library. Quite by chance, I discovered that every Python object created by Boost Python, is at least bigger than ...
3
votes
0answers
100 views

How do I combine numpy “advanced indexing” with `np.newaxis`?

How do I combine numpy "advanced indexing" with np.newaxis? import numpy as np a = np.zeros(10) b = np.zeros(10, dtype=np.bool_) b[4] = True print(a[b]) # [ 0.] print(a[b][:, np.newaxis]) # [[ 0.]] ...
3
votes
0answers
675 views

Why does installing numpy using pip fail, while building directly does not?

I'm trying to install numpy under Python 3.3.0 running Mac OS 10.7.5 (Lion) and using the compilers that come with Xcode 4.5.1. I installed Python 3 and gfortran using homebrew without any hiccups, ...
3
votes
0answers
397 views

import numpy does load shared blas libraries to other modules

We have a library, linked as a module by Cython (core.so). It uses BLAS, but it is compiled with -undefined,dynamic-lookup options in hope that BLAS will be loaded in the runtime. In the Enthought ...
2
votes
0answers
20 views

numpy multivarient regression with linalg.lstsq

I am trying to solve for m1,m2,m3,m4 in the set of equations such that: y=(m1*x1)+(m2*x2)+(m3*x3)+(m4*x4) Where: x1=[x11,x12,x13...] x2=[x21,x22,x23...] x3=[x31,x32,x33...] x4=[x41,x42,x43...] ...
2
votes
0answers
52 views

out-of-core SVD in python

I need to run the python (numpy) code: numpy.linalg.svd(M.dot(M.T)) but M is a dense float64 matrix of shape 100224 x 349800 Obviously, it does not fit in memory. I know pytables is supposed to ...
2
votes
0answers
33 views

Given a matrix, how to find the best cell for each row, without repetition

I have a matrix, the rows are objects, and the columns are objectives, each row represents the distance from an object to an objective. For example, lets consider I have 3 objects O1 O2 O3, and 3 ...

1 2 3 4 5 37
15 30 50 per page