I need a method to shrink it to an 100-item array.
>
> x[::len(x)/panel_width] will not work. If the panel's width is 60, that
> expression will return an array of 61 elements.
>
> I believe there is an existing function in numarray to do this, however
> English is not my mothe
[::len(x)/panel_width] will not work. If the panel's width is 60, that
expression will return an array of 61 elements.
I believe there is an existing function in numarray to do this, however
English is not my mother tongue and math is not my speciality, I can't
find it in the document full of
"Matt Feinstein" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Wed, 01 Jun 2005 08:11:36 -0700, Scott David Daniels
> <[EMAIL PROTECTED]> wrote:
>
>>Propose some fixes to the documents that will make this easier for
>>the next one in line. You don't even need to get it exactly
On Wed, 01 Jun 2005 09:55:14 -0600, Fernando Perez
<[EMAIL PROTECTED]> wrote:
>Just a suggestion: post your message on the numeric discussion list (where
>numarray is also discussed). Most of the num* developers only check c.l.py on
>occasion, so it's very easy that your me
umentation and why I didn't like it. Seriously, what more should I
> do? It's plainly inappropriate for me to write documentation for a
> module that I'm still struggling to learn.
Just a suggestion: post your message on the numeric discussion list (where
numarray is also disc
On Wed, 01 Jun 2005 08:11:36 -0700, Scott David Daniels
<[EMAIL PROTECTED]> wrote:
>Propose some fixes to the documents that will make this easier for
>the next one in line. You don't even need to get it exactly right;
>the person after you can fix the mistakes you make. This is the
>process we
Matt Feinstein wrote:
> I spent all day yesterday trying to figure out how to do file IO in
> the numarray module-- I -did- (I think) figure it all out, eventually,
> but it's left me in a rather sour mood.
>
> Grr.
Propose some fixes to the documents that will make this
I spent all day yesterday trying to figure out how to do file IO in
the numarray module-- I -did- (I think) figure it all out, eventually,
but it's left me in a rather sour mood.
1. The basic functions and methods: fromfile, fromstring, tofile, and
tostring, are buried, in non-alphabetical
"km" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi all,
> is there any support for decimal type in numarray module ?
> regards,
> KM
Still a noob but perhaps you can use gmpy, a wrapper for GMP arbitrary
precision library. I found it here http://g
km wrote:
> Hi all,
> is there any support for decimal type in numarray module ?
Not specifically, no. However, there is the concept of an "object
array," which are arrays of arbitrary Python objects. See numarray.objects .
--
Robert Kern
[EMAIL PROTECTED]
"In the fie
Hi all,
is there any support for decimal type in numarray module ?
regards,
KM
--
http://mail.python.org/mailman/listinfo/python-list
Matt Feinstein wrote:
> On Mon, 16 May 2005 12:03:24 -0600, Steven Bethard
> <[EMAIL PROTECTED]> wrote:
>
>>Can you give an example of what you really want to do? Probably there
>>are numarray functions that you can use. In general, you'll do better
>>app
lse:
> return x*f_out
> return booltest
If efficiency was a concern, I'd probably write this instead as:
py> import numarray as na
py> def genfunc(xmin, xmax, f_in, f_out):
... def booltest(arr):
... is_in = na.logical_and(arr > xmin, arr < xmax)
...
On Mon, 16 May 2005 12:03:24 -0600, Steven Bethard
<[EMAIL PROTECTED]> wrote:
>Can you give an example of what you really want to do? Probably there
>are numarray functions that you can use. In general, you'll do better
>applying a sequence of numarray functions than opera
Matt Feinstein wrote:
> On Mon, 16 May 2005 11:07:06 -0600, Steven Bethard
> <[EMAIL PROTECTED]> wrote:
>
>
>
>>I must be missing something, because the simplest possible thing seems
>>to work for me:
>>
>>py> import numarray as na
>>py>
On Mon, 16 May 2005 11:07:06 -0600, Steven Bethard
<[EMAIL PROTECTED]> wrote:
>
>I must be missing something, because the simplest possible thing seems
>to work for me:
>
>py> import numarray as na
>py> def plus1(arr):
>... return arr + 1
>...
>py>
Matt Feinstein wrote:
> Is there an optimal way to apply a function to the elements of a two-d
> array?
>
> What I'd like to do is define some function:
>
> def plone(x):
> return x+1
>
> and then apply it elementwise to a 2-D numarray. I intend to treat
Is there an optimal way to apply a function to the elements of a two-d
array?
What I'd like to do is define some function:
def plone(x):
return x+1
and then apply it elementwise to a 2-D numarray. I intend to treat the
function as a variable, so ufuncs are probably not appropriat
Am I missing
> something?
logical_and(), logical_or(), etc. These will handle arrays of truth
values rather than treating the array as a single truth value like "and"
and "or" will do. The reason why the latter is left undefined is because
there isn't much solid agreem
If I try
>>> 2 < array([1,2,3])
I get:
array([0, 0, 1], type=Bool)
which is pretty slick, However if I set
>>> q = 2 < array([1,2,3])
>>> q and q
I get a runtime error: "An array doesn't make sense as a truth value."
So.. why not? It seems to me that if I could vectorize logical
expressions
"Peter Otten" <[EMAIL PROTECTED]> wrote:
> George Sakkis wrote:
>
> > Though not the fastest to execute; using concatenate instead of
> > initializing an array from a list [a,a] is more than 2,5 time
faster in
> > my system (~4.6 vs 11.8 usec per loop according to timeit.py), and
it's
> > not harde
George Sakkis wrote:
> Though not the fastest to execute; using concatenate instead of
> initializing an array from a list [a,a] is more than 2,5 time faster in
> my system (~4.6 vs 11.8 usec per loop according to timeit.py), and it's
> not harder either.
That surprises me. I would expect essent
"Peter Otten" <[EMAIL PROTECTED]> wrote:
> George Sakkis wrote:
>
> > What's the fastest and most elegant equivalent of zip() in
> > Numeric/Numarray between two equally sized 1D arrays ? That is, how
to
> > combine two (N,)-shaped arrays to one (N,2)
George Sakkis wrote:
> What's the fastest and most elegant equivalent of zip() in
> Numeric/Numarray between two equally sized 1D arrays ? That is, how to
> combine two (N,)-shaped arrays to one (N,2) (or (2,N)) shaped ? I
> expect the fastest and the most elegant idiom to be id
George Sakkis wrote:
What's the fastest and most elegant equivalent of zip() in
Numeric/Numarray between two equally sized 1D arrays ? That is, how to
combine two (N,)-shaped arrays to one (N,2) (or (2,N)) shaped ? I
expect the fastest and the most elegant idiom to be identical, as it is
us
What's the fastest and most elegant equivalent of zip() in
Numeric/Numarray between two equally sized 1D arrays ? That is, how to
combine two (N,)-shaped arrays to one (N,2) (or (2,N)) shaped ? I
expect the fastest and the most elegant idiom to be identical, as it is
usually the case in
Ah, okay, I didn't remember correctly what arr.tolist did. My mistake.
--
http://mail.python.org/mailman/listinfo/python-list
Jason Mobarak wrote:
It does what the OPs example does, but with numeric types.
It certainly does not.
In [15]:arr = na.arange(100)
In [16]:random.shuffle(arr)
In [17]:arr.shape = (10,10)
In [18]:arr2 = na.array(arr)
In [19]:L = arr.tolist()
In [20]:L.sort()
In [21]:na.array(L)
Out[21]:
array([[ 8,
It does what the OPs example does, but with numeric types.
--
http://mail.python.org/mailman/listinfo/python-list
Jason Mobarak wrote:
import numarray as na
import random
# example array
arr = range(100)
random.shuffle(arr)
arr = na.array(arr)
arr = na.reshape(arr, (10,10))
print arr # not rowsort'ed
arr.flat.sort() # key line
print arr # rowsort'ed
That's definitely not a lexicographic sort.
import numarray as na
import random
# example array
arr = range(100)
random.shuffle(arr)
arr = na.array(arr)
arr = na.reshape(arr, (10,10))
print arr # not rowsort'ed
arr.flat.sort() # key line
print arr # rowsort'ed
--
http://mail.python.org/mailman/listinfo/python-list
Suppose arr is a two dimensional numarray array. Suppose we do the
following:
def rowsort(arr):
a = arr.tolist()
a.sort()
return numarray.array(a)
Can this sort be done efficiently in numarray? This function is called
"rowsort" in MatLab.
--
http://mail.python.org/mailma
Matt Feinstein wrote:
Hi--
I notice that there are some new versions of numarray available for
download-- is there any documentation on what's new/fixed/broken?
You could ask on the numarray list. When you do, you should specify what
version you're coming from so you can get the a
Hi--
I notice that there are some new versions of numarray available for
download-- is there any documentation on what's new/fixed/broken?
Matt Feinstein
--
There is no virtue in believing something that can be proved to be true.
--
http://mail.python.org/mailman/listinfo/python-list
IIRC, no. But the setup.py script is fairly easy to hack to link in
your own blas/lapack libraries.
--
http://mail.python.org/mailman/listinfo/python-list
I have a PC with Debian sid installed. I install all my Python stuff in
/usr/local. I just installed numarray 1.3.1. Blaslite and lapacklite
were compiled. Did the installation process search for blas and lapack?
--
http://mail.python.org/mailman/listinfo/python-list
equences if I use the
Matt> 'wrong' array package-- e.g., put numarray in the .matlabrc
Matt> file if the compile-time package is Numeric. But there's
Matt> only one current, unlabeled, windows installer and there
Matt> seems to have been a change, some t
I'm working my way through the matplotlib documentation & there's a
point that's ambiguous-- the pdf file (dated Mar. 1, 2005) warns of
dire consequences if I use the 'wrong' array package-- e.g., put
numarray in the .matlabrc file if the compile-time package is
ChinStrap wrote:
I know there are probably alternatives for this with the standard
library, but I think that would kill the speed I get with numarray:
Say I have two 2-dimensional numarrays (x_mat and y_mat, say), and a
function f(x,y) that I would like to evaluate at every index.
Basically I want
Oh well. I am downloading all the things to build it, but in the mean
time I just did:
def get_y_mat(x_ind,y_ind):
return self.y_min + y_ind*self.dy
def get_x_mat(x_ind,y_ind):
return self.x_min + x_ind*self.dx
self.x_mat=fromfunction(get_x_mat,m
ChinStrap wrote:
Are there no windows binaries for SciPy for python 2.4 yet? I try to
run the installer and it complains that it can't find python 2.3.
No, not yet.
Besides that, vectorize is exactly what i want.
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
A
Are there no windows binaries for SciPy for python 2.4 yet? I try to
run the installer and it complains that it can't find python 2.3.
Besides that, vectorize is exactly what i want.
--
http://mail.python.org/mailman/listinfo/python-list
ChinStrap wrote:
I know there are probably alternatives for this with the standard
library, but I think that would kill the speed I get with numarray:
Say I have two 2-dimensional numarrays (x_mat and y_mat, say), and a
function f(x,y) that I would like to evaluate at every index.
Basically I want
I know there are probably alternatives for this with the standard
library, but I think that would kill the speed I get with numarray:
Say I have two 2-dimensional numarrays (x_mat and y_mat, say), and a
function f(x,y) that I would like to evaluate at every index.
Basically I want to be able to
Thanks, that explains why the CygWin Python will not import the .pyd
files:
>>> imp.get_suffixes()
[('.dll', 'rb', 3), ('module.dll', 'rb', 3), ('.py', 'U', 1), ('.pyc',
'rb', 2)]
Doesn't look like there's a way to get the CygWin Python to load .pyd
files. So I guess I have to figure out why the
<[EMAIL PROTECTED]> wrote:
> ImportError: No module named _conv
> The file _conf.pyd exists, but my guess is that the .pyd suffix is not
> recognized under the CygWin version of Python. (But that doesn't make
> sense...)
you can use imp.get_suffixes() to get a list of supported extensions.
her
I'm trying to use the 'numarray' package (v1.1.1) under Python 2.4
running under CygWin.
I initially downloaded the Windows executable version of the numarray
package, and installed it under C:\program
files\python\lib\site-packages. That works with the Windows version of
Pyth
Jean Moser wrote:
I tried many times to connect to numarray without success.
I choosed the release: numarray-1.1.1.win32py2.2.exe then I went to
the setup program made by Greenfield and I tried to follow the
commands.The mentioned Python directory is C:\PROGRA~2 which is not
covenient. I tried to
I tried many times to connect to numarray without success.
I choosed the release: numarray-1.1.1.win32py2.2.exe then I went to
the setup program made by Greenfield and I tried to follow the
commands.The mentioned Python directory is C:\PROGRA~2 which is not
covenient. I tried to change it but
S I wasn't sure if no one replied because a) this question was too
dumb or b) this question was too hard... it was definitely the former.
But I'll post the answer, anyway:
I forgot to keep in mind - when reading the documentation, assume that
a
>>> from numarray import *
Hi. I have a very simple task to perform and I'm having a hard time
doing it.
Given an array called 'x' (created using the numarray library), is
there a single command that rounds each of its elements to the nearest
integer? I've already tried something like
>
101 - 151 of 151 matches
Mail list logo