hi
while trying to make an eigenface image from a numpy array of floats i
tried this
from numpy import array
import Image
imagesize=(200,200)
def makeimage(inputarray,imagename):
inputarray.shape=(-1,)
newimg=Image.new('L', imagesize)
newimg.putdata(inputarray)
Easy solution:
Use pylab's imashow(inputarray).
In general ipython+matplolib are very handy for your kind of analysis
Longer solution:
Scale your array:
a_min = inputarray.min()
a_max = inputarray.max()
disp_array = ((inputarray-a_min)* 255/(a_max -
Hi All,
Where can I find docs for masked arrays?
The paid for book doesn't even contain the phrase masked_where :-(
cheers,
Chris
--
Simplistix - Content Management, Zope Python Consulting
- http://www.simplistix.co.uk
___
OK, my specific problem with masked arrays is as follows:
a = numpy.array([1,numpy.nan,2])
aa = numpy.ma.masked_where(numpy.isnan(a),a)
aa
array(data =
[ 1.e+00 1.e+20 2.e+00],
mask =
[False True False],
fill_value=1e+020)
In arrayobject.c, various complex functions (e.g., array_imag_get) use:
PyArray_ISCOMPLEX - PyTypeNum_ISCOMPLEX,
which is hard coded to 2 predefined types :(
If PyArray_ISCOMPLEX allowed user-defined types, I'm guessing functions such
as array_imag_get would just work?
http://scipy.org/scipy/numpy/newticket#preview is giving me:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable
to complete your request.
Please contact the server administrator, [EMAIL PROTECTED] and inform them
of the time the error occurred, and
Longer solution:
Scale your array:
a_min = inputarray.min()
a_max = inputarray.max()
disp_array = ((inputarray-a_min)* 255/(a_max - a_min)).astype('uint8')\
.
thanx Nadav..the scaling works..and makes clear images
but why .astype(uint8) ? can't i use the array of
I have found that any search on that document containing an
underscore will turn up zero matches. Substitute a space instead.
On Mar 19, 2008, at 5:02 AM, Chris Withers wrote:
Where can I find docs for masked arrays?
The paid for book doesn't even contain the phrase masked_where :-(
**
Hi,
I'm passing (possibly non-contiguous) numpy arrays (data + shape +
strides + ndim) with ctypes to my C++ function (with external C to
make ctypes happy). Has anyone made a C++ class derived from a ctypes-
numpy-array with an overloaded [] operator to allow easy indexing
(e.g.
Hi,
On my blog, I spoke about the class we used. It is not derived from a Numpy
array, it is implemented in terms of a Numpy array (
http://matt.eifelle.com/item/5)
Matthieu
2008/3/19, Joris De Ridder [EMAIL PROTECTED]:
Hi,
I'm passing (possibly non-contiguous) numpy arrays (data + shape +
Bill Spotz wrote:
I have found that any search on that document containing an
underscore will turn up zero matches. Substitute a space instead.
That's not been my experience. I found the *one* mention of fill_value
just fine, the coverage of masked arrays is woeful :-(
Chris
--
For the not blocker bugs, I think that #420 should be closed : float32 is
the the C float type, isn't it ?
Matthieu
2008/3/13, Jarrod Millman [EMAIL PROTECTED]:
Hello,
I am sure that everyone has noticed that 1.0.5 hasn't been released
yet. The main issue is that when I was getting ready
Neal Becker wrote:
In arrayobject.c, various complex functions (e.g., array_imag_get) use:
PyArray_ISCOMPLEX - PyTypeNum_ISCOMPLEX,
which is hard coded to 2 predefined types :(
If PyArray_ISCOMPLEX allowed user-defined types, I'm guessing functions such
as array_imag_get would just work?
Travis E. Oliphant wrote:
Neal Becker wrote:
In arrayobject.c, various complex functions (e.g., array_imag_get) use:
PyArray_ISCOMPLEX - PyTypeNum_ISCOMPLEX,
which is hard coded to 2 predefined types :(
If PyArray_ISCOMPLEX allowed user-defined types, I'm guessing functions
such as
On Wed, Mar 19, 2008 at 10:42 AM, Travis E. Oliphant [EMAIL PROTECTED]
wrote:
Neal Becker wrote:
In arrayobject.c, various complex functions (e.g., array_imag_get) use:
PyArray_ISCOMPLEX - PyTypeNum_ISCOMPLEX,
which is hard coded to 2 predefined types :(
If PyArray_ISCOMPLEX allowed
I recently had a personal email reply from Damian
Menscher who originally found the error in 2002. He
states:
--
I explained the solution in a followup to my own post:
http://mail.python.org/pipermail/python-list/2002-August/161395.html
-- in short, find the dlasd4_ routine (for the current
On Wed, Mar 19, 2008 at 11:30 AM, Lou Pecora [EMAIL PROTECTED] wrote:
I recently had a personal email reply from Damian
Menscher who originally found the error in 2002. He
states:
--
I explained the solution in a followup to my own post:
Hi,
I'm trying to do a PDE style calculation with numpy arrays
y = a * x[:-2] + b * x[1:-1] + c * x[2:]
with a,b,c constants. I realise I could use correlate for this, i.e
y = numpy.correlate(x, array((a, b, c)))
however the performance doesn't seem as good (I suspect correlate is
optimised
Hello,
Thanks to everyone who has been working on getting the 1.0.5 release
of NumPy out the door. Since my last email at least 12 bug tickets
have been closed. There are a few remaining issues with the trunk,
but we are fasting approaching a release.
One additional issue that I would like to
On Wed, Mar 19, 2008 at 12:57 PM, Peter Creasey
[EMAIL PROTECTED] wrote:
Hi,
I'm trying to do a PDE style calculation with numpy arrays
y = a * x[:-2] + b * x[1:-1] + c * x[2:]
with a,b,c constants. I realise I could use correlate for this, i.e
y = numpy.correlate(x, array((a, b, c)))
OK, my specific problem with masked arrays is as follows:
a = numpy.array([1,numpy.nan,2])
aa = numpy.ma.masked_where(numpy.isnan(a),a)
aa
array(data =
[ 1.e+00 1.e+20 2.e+00],
mask =
[False True False],
fill_value=1e+020)
Dear NumPy users,
The developers of the PyDSTool dynamical systems software project have
money to hire a Python programmer on a short-term, per-task basis as a
technical consultant. The work can be done remotely and will be paid after
the completion of project milestones. The work must be
Charles R Harris wrote:
Image processing may be a special in that many cases it is almost
embarrassingly parallel. Perhaps some special libraries for that sort
of application could be put together and just bits of c code be run on
different processors. Not that I know much about parallel
I never used the putdata interface but the fromstring. It is likely that
putdata is more flexible. However I urge you to use matplotlib: plotting with
imshow followed by colorbar(), enables use to inspect the true pixels value,
add grids, zoom etc.
Nadav.
-הודעה מקורית-
מאת:
24 matches
Mail list logo