On 08/17/2010 09:53 AM, Nikolaus Rath wrote:
Hello,
I want to find the first i such that x[i] y and x[i+1]= y. Is there
a way to do this without using a Python loop?
I can't use np.searchsorted(), because my x array crosses y several
times.
Best,
-Nikolaus
i =
I am trying out masked arrays for the first time and having some
problems. I have a 2-D image as dtype=numpy.int16
I create a mask of all False to not mask out any pixels.
I calculate the mean of the image original image and it comes out ~597.
I calculate the mean of the masked array and it
On Apr 10, 2010, at 5:17 AM, josef.p...@gmail.com wrote:
On Sat, Apr 10, 2010 at 3:49 AM, Lane Brooks l...@brooks.nu wrote:
I am trying out masked arrays for the first time and having some
problems. I have a 2-D image as dtype=numpy.int16
I create a mask of all False to not mask out any
James wrote:
Hi,
Thanks for all your help so far!
Right i think it would be easier to just show you the chart i have so far;
--
import numpy as np
import matplotlib.pyplot as plt
plt.plot([4,8,12,16,20,24], [0.008,0.016,0.021,0.038,0.062,0.116], 'bo')
Travis E. Oliphant wrote:
Lane Brooks wrote:
I am using the numpy CAPI to write an extension module that returns a
numpy Array from an imaging data source. I collect the image into a
buffer that I allocate. I then create numpy Array using the
PyArray_New(..) function and pass
questions:
1. Does NPY_OWNDATA mean that the object will deallocate the memory when
the object is deleted? The manual seems to indicate that as such but it
is not explicitly stated.
2. Is my reference counting correct? Do I need to call the
PyArray_INCREF() on img?
Thanks,
Lane Brooks
If you want the indexes, check out the np.where command, e.g.
idx = np.where(dat = limit)
If you want the values, use:
val = dat[dat = limit]
Lane
Michael wrote:
Hi list,
been playing around with stride_tricks and find it terrifically
productive; thankyou to everyone who has worked on
What are the preferred ways to get images, like jpgs and pngs, from disk
into a numpy array and from a numpy array to disk?
I did some google searches and found a PEP thread where Travis was
proposing an extended buffer protocol that would make for easier
interoperability with libraries such
Robert Kern wrote:
On Sat, Oct 18, 2008 at 23:07, Lane Brooks [EMAIL PROTECTED] wrote:
What are the preferred ways to get images, like jpgs and pngs, from disk
into a numpy array and from a numpy array to disk?
I did some google searches and found a PEP thread where Travis was
proposing
Linda Seltzer wrote:
Here is an example that works for any working numpy installation:
import numpy as npy
npy.zeros((256, 256))
This suggestion from David did work so far, and removing the other import
line enabled the program to run.
However, the data types the program used as defaults
When writing an numpy extension module, what is the preferred way to
deal with the all the possible types an ndarray can have?
I have some data processing functions I need to implement and they need
to be generic and work for all the possible numerical dtypes. I do not
want to have to
Travis E. Oliphant wrote:
Lane Brooks wrote:
When writing an numpy extension module, what is the preferred way to
deal with the all the possible types an ndarray can have?
I have some data processing functions I need to implement and they need
to be generic and work for all the possible
Travis E. Oliphant wrote:
Lane Brooks wrote:
Travis E. Oliphant wrote:
Lane Brooks wrote:
When writing an numpy extension module, what is the preferred way to
deal with the all the possible types an ndarray can have?
I have some data processing functions I need
I have successfully written several extension modules that use the numpy
CAPI to manipulate numpy arrays. I have to say numpy is great.
I am now having a problem, however, when calling numpy capi functions
when running python embedded in a third party, closed source,
application. It
David Cournapeau wrote:
Lane Brooks wrote:
I have successfully written several extension modules that use the numpy
CAPI to manipulate numpy arrays. I have to say numpy is great.
I am now having a problem, however, when calling numpy capi functions
when running python embedded
15 matches
Mail list logo