Mark Bakker wrote:
Hello -
I want to select part of an array using two conditions.
I know how to do it with one condition (and it works great), but when
I use two conditions I get an error message?
This is probably easy, but I cannot figure it out.
Thanks for any help, Mark
a =
Le mardi 10 octobre 2006 16:30, Darren Dale a écrit :
On Tuesday 10 October 2006 15:41, [EMAIL PROTECTED] wrote:
I asked if that will be possible to use ipython instead of the python
console in eric4 (I know that it's not possible with eric3) but it's
seems that eric4 does have it's own
Just FYI, I got the following warning while running the unittests from RC02:
Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on
win32
Type copyright, credits or license() for more information.
Python's MT documentation exmphasize the period of the
MT19937 algorithm but discusses not at all the seed size.
The numpy documentation contains no commentary (I believe).
Speaking from a position of utter RNG ignorance, seed size
seems really important too: why is it not discussed?
I noticed
On 10/11/06, Keith Goodman [EMAIL PROTECTED] wrote:
This works:
M.asmatrix(['a', 'b', None])
matrix([[a, b, None]], dtype=object)
But this doesn't:
M.asmatrix(['a', 'b', None, 'c'])
TypeError: expected a readable buffer object
M.__version__
'1.0rc1'
It also doesn't work for
On 10/11/06, Alan G Isaac [EMAIL PROTECTED] wrote:
Python's MT documentation exmphasize the period of theMT19937 algorithm but discusses not at all the seed size.The numpy documentation contains no commentary (I believe).Speaking from a position of utter RNG ignorance, seed size
seems really
On Wednesday 11 October 2006 12:48, Carl Wenrich wrote:
The installation of Numpy went well, and numeric.py is in the python
site-packages/numpy/core directory. But when I run python, and enter import
Numeric, it says no module named Numeric. Please advise.
import numpy
On 10/11/06, Keith Goodman [EMAIL PROTECTED] wrote:
On 10/11/06, Keith Goodman [EMAIL PROTECTED] wrote: This works: M.asmatrix(['a', 'b', None]) matrix([[a, b, None]], dtype=object)
But this doesn't: M.asmatrix(['a', 'b', None, 'c']) TypeError: expected a readable buffer objectAs a side
thanks, but actually it's the other applications i want to use that have the 'import Numeric' line in them. i'm sure others have noted this before. what's the normal procedure?Darren Dale [EMAIL PROTECTED] wrote: On Wednesday 11 October 2006 12:48, Carl Wenrich wrote: The installation of Numpy
Carl Wenrich wrote:
thanks, but actually it's the other applications i want to use that
have the 'import Numeric' line in them. i'm sure others have noted
this before. what's the normal procedure?
You must install Numeric if a package needs Numeric. As far as Python
is concerned NumPy is
thanks.Travis Oliphant [EMAIL PROTECTED] wrote: Carl Wenrich wrote: thanks, but actually it's the other applications i want to use that have the 'import Numeric' line in them. i'm sure others have noted this before. what's the normal procedure?You must install Numeric if a package needs Numeric.
On 10/11/06, Nils Wagner [EMAIL PROTECTED] wrote:
Mark Bakker wrote:
Hello -
I want to select part of an array using two conditions.
I know how to do it with one condition (and it works great), but when
I use two conditions I get an error message?
This is probably easy, but I cannot
Hi all,
Py3K is undergoing active development. This gives us an opportunity to
discuss more significant changes to the language that might improve the
experience of NumPy users.
We should form a list and start commenting on the py3k mailing lists
about what changes would be most helpful
Travis Oliphant wrote:
A couple on my short list
1) Adding a *few* new infix operators.
a) an extra multiplication operator to distinguish between
element-by-element and dot
b) extending 'and' and 'or' to allow element-by-element logical
operations or adding and ||
2)
Christopher Barker wrote:
Travis Oliphant wrote:
A couple on my short list
1) Adding a *few* new infix operators.
a) an extra multiplication operator to distinguish between
element-by-element and dot
b) extending 'and' and 'or' to allow element-by-element logical
operations or
On 10/11/06, Travis Oliphant [EMAIL PROTECTED] wrote:
Hi all,Py3K is undergoing active development.This gives us an opportunity todiscuss more significant changes to the language that might improve theexperience of NumPy users.We should form a list and start commenting on the py3k mailing lists
Here log in you are raquo Magazine Home Todays
Compact din Rail.Just anything in several skins choose between own style
Creating takes few seconds click get.Create truly unique layout Change every
of image Template system Thread a count Total.Modules Devices Embedded
Systems Displays
Hi,
I have recieved the following note from a user:
In SciPy 0.3.x the ufuncs were overloaded by more intelligent versions.
A very attractive feature was that sqrt(-1) would yield 1j as in Matlab.
Then you can program formulas directly (e.g., roots of a 2nd order
polynomial) and the right
On 10/11/06, Greg Willden [EMAIL PROTECTED] wrote:
Hi All,I've read discussions in the archives about how round() rounds to even and how that is supposedly better.But what I haven't been able to find is What do I use if I want the regular old round that you learn in school?
Perhaps you could
Hi,
I know that it's a perennial topic on the list, but I haven't been able
to find my answer in the archives. After running the installation on a
RedHat Linux machine, I'm getting the import error:
/usr/lib/libblas.so.3: undefined symbol: e_wsfe. Judging from earlier
exchanges here, it seems
On 10/11/06, Charles R Harris [EMAIL PROTECTED] wrote:
Perhaps you could explain *why* you want the schoolbook round? Given that floating point is inherently inaccurate you would have to expect to produce a lot of numbers exactly of the form x.5 *without errors*, which means you probably don't
Hmm. I learned round to even in school...
But another formula that should get you what you want is:
floor(x + 0.5).astype(int)
--bb
On 10/12/06, Greg Willden [EMAIL PROTECTED] wrote:
Hi All,
I've read discussions in the archives about how round() rounds to even and
how that is supposedly
[EMAIL PROTECTED] wrote:
Hi,
I have recieved the following note from a user:
In SciPy 0.3.x the ufuncs were overloaded by more intelligent versions.
A very attractive feature was that sqrt(-1) would yield 1j as in Matlab.
Then you can program formulas directly (e.g., roots of a 2nd order
Travis Oliphant schrieb:
If not, shouldn't
numpy.sqrt(-1) raise a ValueError instead of returning silently nan?
This is user adjustable. You change the error mode to raise on
'invalid' instead of pass silently which is now the default.
-Travis
Could you please explain how
Sven Schreiber wrote:
This is user adjustable. You change the error mode to raise on
'invalid' instead of pass silently which is now the default.
-Travis
Could you please explain how this adjustment is done, or point to the
relevant documentation.
numpy.sqrt(-1)
old =
On 10/11/06, Travis Oliphant [EMAIL PROTECTED] wrote:
[EMAIL PROTECTED] wrote:
Could sqrt(-1) made to return 1j again?
Not in NumPy. But, in scipy it could.
Without taking sides on which way to go, I'd like to -1 the idea of a
difference in behavior between numpy and scipy.
IMHO, scipy
On 11/10/06, Charles R Harris [EMAIL PROTECTED] wrote:
Speaking long term, what about data types? The basic 80 bit extended
precision float now occurs in 80, 96, and 128 bit versions depending on
alignment. So what happens when quad precision, which will probably be in
the next IEEE standard,
A. M. Archibald wrote:
IEEE floats in python proper
+1
-CHB
--
Christopher Barker, Ph.D.
Oceanographer
NOAA/ORR/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main
Travis Oliphant wrote:
Sven Schreiber wrote:
This is user adjustable. You change the error mode to raise on
'invalid' instead of pass silently which is now the default.
-Travis
Could you please explain how this adjustment is done, or point to the
relevant
On 10/11/06, Travis Oliphant [EMAIL PROTECTED] wrote:
Fernando Perez wrote:
IMHO, scipy should be within reason a strict superset of numpy.
This was not the relationship of scipy to Numeric.
For me, it's the fact that scipy *used* to have the behavior that
scipy.sqrt(-1) return 1j
On 10/11/06, Travis Oliphant [EMAIL PROTECTED] wrote:
Fernando Perez wrote:
There are people who import scipy for everything, others distinguish
between numpy and scipy, others use numpy alone and at some point in
their life's code they do
import numpy as N - import scipy as N
because
On Wed, 11 Oct 2006, Travis Oliphant wrote:
On the other hand requiring all calls to numpy.sqrt to go through an
argument-checking wrapper is a bad idea as it will slow down other uses.
Interestingly, in worst cases numpy.sqrt is approximately ~3 times slower
than scipy.sqrt on negative
Stefan van der Walt wrote:
I agree with Fernando on this one.
Further, if I understand correctly, changing sqrt and power to give
the right answer by default will slow things down somewhat. But is it
worth sacrificing intuitive usage for speed?
For NumPy, yes.
This is one reason that
[EMAIL PROTECTED] wrote:
On Wed, 11 Oct 2006, Travis Oliphant wrote:
On the other hand requiring all calls to numpy.sqrt to go through an
argument-checking wrapper is a bad idea as it will slow down other uses.
Interestingly, in worst cases numpy.sqrt is approximately ~3 times
I'm running the following
python c:\Python24\Scripts\f2py.py --fcompiler=absoft -c foo.pyf foo.f
and it seems that the compiler info isn't being passed down. When
distutils tries to compile I get the error
---
File
Johannes Loehnert wrote:
I'm just wondering if there is a way that i can increment all the values
along a diagonal?
Assume you want to change mat.
# min() only necessary for non-square matrices
index = arange(min(mat.shape[0], mat.shape[1]))
# add 1 to each diagonal element
On Wed, 11 Oct 2006, Travis Oliphant wrote:
Interestingly, in worst cases numpy.sqrt is approximately ~3 times slower
than scipy.sqrt on negative input but ~2 times faster on positive input:
In [47]: pos_input = numpy.arange(1,100,0.001)
In [48]: %timeit -n 1000 b=numpy.sqrt(pos_input)
Tim Hochberg wrote:
With python 2.5 out now, perhaps it's time to come up with a with
statement context manager. Something like:
from __future__ import with_statement
import numpy
class errstate(object):
def __init__(self, **kwargs):
self.kwargs = kwargs
On 10/12/06, David Novakovic [EMAIL PROTECTED] wrote:
Johannes Loehnert wrote:
This is very nice, exactly what i want, but it doesnt work for mxn
matricies:
x = zeros((5,3))
x
array([[0, 0, 0],
[0, 0, 0],
[0, 0, 0],
[0, 0, 0],
[0, 0, 0]])
index =
nan's are making things really slow,
Yeah, they do. This actually makes the case for masked arrays, rather
than using NAN's.
Travis,
Talking about masked arrays, I'm about being done rewriting numpy.core.ma,
mainly transforming MaskedArray as a subclass of ndarray (it should be OK by
the
On Wed, Oct 11, 2006 at 05:21:44PM -0600, Travis Oliphant wrote:
Stefan van der Walt wrote:
I agree with Fernando on this one.
Further, if I understand correctly, changing sqrt and power to give
the right answer by default will slow things down somewhat. But is it
worth sacrificing
Thanks for the help, i've learnt a lot and also figured out something
that does what I want, i'll paste an interactive session below:
x = zeros((4,7))
x
array([[0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0]])
index =
On 11/10/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
In SciPy 0.3.x the ufuncs were overloaded by more intelligent versions.
A very attractive feature was that sqrt(-1) would yield 1j as in Matlab.
Then you can program formulas directly (e.g., roots of a 2nd order
polynomial) and the
David Novakovic wrote:
Thanks for the help, i've learnt a lot and also figured out something
that does what I want, i'll paste an interactive session below:
x = zeros((4,7))
x
array([[0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0,
On Wed, Oct 11, 2006 at 08:24:01PM -0400, A. M. Archibald wrote:
What is the desired behaviour of sqrt?
[...]
Should it return a complex array only when any entry in its input is
negative? This will be even *more* surprising when a negative (perhaps
even -0) value appears in their matrix
This is a meta-statement about this argument.We already had it. Repeatedly. Whether you choose it one way or the other, for Numeric the community chose it the way it did for a reason. It is a good reason. It isn't stupid. There were good reasons for the other way. Those reasons weren't stupid. It
Travis Oliphant wrote:
Tim Hochberg wrote:
With python 2.5 out now, perhaps it's time to come up with a with
statement context manager. Something like:
from __future__ import with_statement
import numpy
class errstate(object):
def __init__(self, **kwargs):
David Novakovic wrote:
Hi,
i'm moving some old perl PDL code to python. I've come across a line
which changes values in a diagonal line accross a matrix.
matrix.diagonal() returns a list of values, but making changes to these
does not reflect in the original (naturally).
I'm just
On 10/11/06, Travis Oliphant [EMAIL PROTECTED] wrote:
Stefan van der Walt wrote:Further, if I understand correctly, changing sqrt and power to givethe right answer by default will slow things down somewhat.But is itworth sacrificing intuitive usage for speed?
For NumPy, yes.This is one reason that
Greg Willden wrote:
On 10/11/06, *Travis Oliphant* [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] wrote:
Stefan van der Walt wrote:
Further, if I understand correctly, changing sqrt and power to give
the right answer by default will slow things down somewhat. But
is it
On 10/11/06, Tim Hochberg [EMAIL PROTECTED] wrote:
Greg Willden wrote: On 10/11/06, *Travis Oliphant* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote:
Stefan van der Walt wrote: Further, if I understand correctly, changing sqrt and power to give the right answer by default will slow things down
51 matches
Mail list logo