NumPy is a scientific and numerical computing extension to the Python programming language.
6
votes
0answers
137 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 ...
5
votes
0answers
123 views
f2py: Exposing parameters from “used” modules
I assume that this question has been addressed somewhere, but I have spent an inordinate amount of time looking around for the answer including digging into the source code a bit. I have tried to put ...
4
votes
0answers
78 views
Multiprocessing incompatible with NumPy
I am trying to run a simple test using multiprocessing. The test works well until I import numpy (even though it is not used in the program). Here is the code:
from multiprocessing import Pool
import ...
3
votes
0answers
69 views
Speed of numpy.ctypeslib.as_array
I have a C library that I am wrapping in Python using ctypes. The C library contains many arrays (tens of thousands of arrays on the order of 5-100 elements each, plus a few much longer arrays) that I ...
3
votes
0answers
139 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
168 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
296 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
76 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
186 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
164 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
762 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
97 views
Keeping a numpy ndarray subclass as the return value during a transformation. Safe to set __array_priority__?
I'm trying to subclass numpy's ndarray class, and have had some luck. The behavior that I would like is nearly exactly the same as the example given in the documentation. I want to add a parameter ...
3
votes
0answers
431 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 ...
3
votes
0answers
510 views
Importing csv into Numpy datetime64
I am trying out the latest version of numpy 2.0 dev:
np.__version__
Out[44]: '2.0.0.dev-aded70c'
I am trying to import CSV data that looks like this:
...
3
votes
0answers
100 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 ...