Hi,
it seems that I have the same trouble, but using Python under Linux:
I have run into an interesting issue with multiarraymodule.c with
regards to embedding Python in a C application on Windows XP. In the
application, the following abbreviated sequence was executed
1) Py_Initialize
Christian Meesters wrote:
Hi
This questions might seem stupid, but I didn't get a clever solution myself,
or found one in the archives, the cookbook, etc. . If I overlooked something,
please give a pointer.
Well, if I have an 1D array like
[ 0. , 0.1, 0.2, 0.3, 0.4, 0.5]
,a
Try searchsorted.
Thanks, but that doesn't work. Sorry, if my question wasn't clear.
To illustrate the requirement:
For instance:
a
array([ 0. , 0.1, 0.2, 0.3, 0.4])
# should be 1
...
a.searchsorted(0.11)
2
# should be 2
...
a.searchsorted(0.16)
2
I could correct for one index
Christian Meesters wrote:
Try searchsorted.
Thanks, but that doesn't work. Sorry, if my question wasn't clear.
To illustrate the requirement:
For instance:
a
array([ 0. , 0.1, 0.2, 0.3, 0.4])
# should be 1
...
a.searchsorted(0.11)
2
# should be 2
...
a.searchsorted(0.16)
2
I
On Wed, Feb 07, 2007 at 10:35:14AM +, Christian wrote:
Hi,
when creating an ndarray from a list, how can I force the result to be
2d *and* a column vector? So in case I pass a nested list, there will be no
modification of the shape and when I pass a simple list, it will be
converted to
On Wed, Feb 07, 2007 at 02:00:52PM +0100, Christian Meesters wrote:
This questions might seem stupid, but I didn't get a clever solution myself,
or found one in the archives, the cookbook, etc. . If I overlooked something,
please give a pointer.
Well, if I have an 1D array like
[ 0. ,
Hi,
I'm confused by the output of apply_along_axis() in the following very simple
example:
In [93]: a = arange(12.).reshape(2,2,3)
In [95]: a
Out[95]:
array([[[ 0., 1., 2.],
[ 3., 4., 5.]],
[[ 6., 7., 8.],
[ 9., 10., 11.]]])
In [96]: def myfunc(b):
Keith Goodman wrote:
I'd like to know what the -1 means.
It means fill in with whatever is necessary to make the size correct given the
other specified dimensions.
But first I'm trying to figure out
why there are two reshapes?
reshape() used to be simply a function, not a method.
Do they
I am trying to register a custom type to numpy. When I do so it works
and the ufuncs work but then when I invoke any ufunc twice the second
time my python interpretter segfaults. I think i know what the
problem is. In the select_types method in ufuncobject.c in
numpy/core/src/ numpy gets a
Tom Denniston wrote:
I am trying to register a custom type to numpy. When I do so it works
and the ufuncs work but then when I invoke any ufunc twice the second
time my python interpretter segfaults. I think i know what the
problem is. In the select_types method in ufuncobject.c in
On Wed, 2007-02-07 at 14:36 -0700, Travis Oliphant wrote:
Sturla Molden wrote:
def __new__(cls,...)
...
(H, edges) = numpy.histogramdd(..)
cls.__defaultedges = edges
def __array_finalize__(self, obj):
if not hasattr(self, 'edges'):
self.edges =
Many thanks, Travis. I'll test the new version tonight.
--Tom
On 2/7/07, Travis Oliphant [EMAIL PROTECTED] wrote:
Tom Denniston wrote:
I am trying to register a custom type to numpy. When I do so it works
and the ufuncs work but then when I invoke any ufunc twice the second
time my python
Reggie Dugard wrote:
On Wed, 2007-02-07 at 14:36 -0700, Travis Oliphant wrote:
Sturla Molden wrote:
def __new__(cls,...)
...
(H, edges) = numpy.histogramdd(..)
cls.__defaultedges = edges
def __array_finalize__(self, obj):
if not hasattr(self, 'edges'):
self.edges
Robert Kern wrote:
Does anyone know if there will be a SciPy '07 conference, and if so, when?
Yes, there will be one. We are currently speaking with the venue (Caltech in
Pasadena, CA) to set the dates. Expect the conference to be either late August
or perhaps earlyish in September.
Nice to
Sturla Molden wrote:
Good point. I guess I thought the OP had tried that already. It turns
out it works fine, too.
The __array_finalize__ is useful if you want the attribute to be carried
around when arrays are created automatically internally (after math
operations for example).
I too
Christopher Barker Chris.Barker at noaa.gov writes:
I'm not sure I understand the specification of the problem. I would
think that the definition of a column vector is that it's shape is:
(-1,1)
I was not aware of that possibility althoug I own the book I - shame on me.
Thank you (and all
Christian Meesters meesters at uni-mainz.de writes:
Since searchsorted returns the index of the first item in a that is = or
the key, it can't make the distinction between 0.1 and 0.2 as I would like to
Then how about a.searchsorted(val+0.5)
Christian
Sven Schreiber svetosch at gmx.net writes:
So I think what's needed is:
b = array(yourlist)
b.reshape(b.shape[0], -1)
Yes! That is it.
Thanks, Christian
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
Pierre GM wrote:
All,
I want to compare whether two arrays point to the same data.
I've been using 'is' so far, but I'm wondering whether it's the right
approach.
It isn't. Your analysis is correct.
--
Robert Kern
I have come to believe that the whole world is an enigma, a harmless
On 2/7/07, Christian [EMAIL PROTECTED] wrote:
Sven Schreiber svetosch at gmx.net writes:
So I think what's needed is:
b = array(yourlist)
b.reshape(b.shape[0], -1)
Row vectors are easy to get.
In [1]: asmatrix([1,2,3,4])
Out[1]: matrix([[1, 2, 3, 4]])
And nested lists work, but you
Keith Goodman kwgoodman at gmail.com writes:
matrix([[ 0.94425407, 0.02216611, 0.999475 ],
[ 0.40444129, nan, 0.23264341],
[ 0.24202372, 0.05344269, 0.37967564]])
x.max()
0.379675636032 Wrong (for me)
x[1,1] = 0
x.max()
0.999474999444 -
21 matches
Mail list logo