found another pseudorandom number generator that I could
just switch to a benefit; the rest of them are less exciting.
When you say 32-bit integers do you really mean 32-bit, or do you
mean machine width? 32-bit integers may not be faster on 64-bit
platforms...
A. M. Archibald
indexing wizardry.
A. M. Archibald
from numpy import zeros, shape, newaxis, repeat, where, indices, asarray
import sys
def todiagonal(A,axis=-1):
A = asarray(A)
s = shape(A)
if axis0:
axis += len(s)
if not 0=axislen(s):
raise IndexError, Axis out of range
# Concoct an index
On 04/09/06, Robert Kern [EMAIL PROTECTED] wrote:
A. M. Archibald wrote:
In the same project I also noticed it would be nice to be able to
(say) do exponential(2+sin(arange(10))) to get an array of
exponentials with varying parameters.
Travis O. recently added this capability
depending on the
implementation).
Are 32-bit numbers really the right least common denominator? There
are plenty of 64-bit platforms out there...
Given this API, implementing a subclassable class that exports it
should satisfy most people's needs for interchangeable generators.
A. M. Archibald
are always logically C-ordered even if the underlying
representation is different. Does it make sense to specify this
somewhere in the docstring? At least it would be good to make it clear
that the order parameter affects only the underlying storage format,
and not the indexing of the array.
A. M. Archibald
code will actually
break?
A. M. Archibald
-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere
towards music, audio signal
processing, 2D and 3D video. (They're related to Max and jMax, which
do some of the same things.)
A. M. Archibald
-
Using Tomcat but need to do more? Need to support web services, security?
Get
On 19/09/06, Tim Hochberg [EMAIL PROTECTED] wrote:
A. M. Archibald wrote:
Mmm. Somebody who's working with NaNs has more or less already decided
they don't want to be pestered with exceptions for invalid data.
Do you really think so? In my experience NaNs are nearly always just
returning arrays in which the
non-NaNs are unsorted, is really bad.
A. M. Archibald
-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions
flags, which would be
extremely useful to have, and which are being wored on, IIRC.
A. M. Archibald
-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
only if there are any NaNs (also, you can't use == for NaNs, you have
to use C isNaN). But I'm starting to see the wisdom in simply throwing
an exception, since sorting is not well-defined with NaNs.
A. M. Archibald
-
Take
is
reshuffled requires a lot of work and isn't particularly better. I
mostly presented it as an alternative to throwing an exception.
Throwing a Python exception now seems like the most reasonable idea.
A. M. Archibald
-
Take
that the interpretor does that eval doesn't do?
No. Eval evaluates expressions, that is, formulas producing a value.
a=b does not produce a value, so you are obtaining the same error
you would if you'd written
if a=b:
...
The way you run code that doesn't return a value is with exec.
A. M
).
More generally, all the tricks that ATLAS uses to accelerate BLAS
routines would (in principle) be applicable here. The implementation
would be extremely difficult, though, even if all the basic loops
could be expressed in a few primitives.
A. M. Archibald
(lambda *args: args)? Almost works, only it
sometimes segfaults with more than two arguments... but that's clearly
a numpy bug.
A. M. Archibald
-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay
involved.
A. M. Archibald
-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT business topics through brief surveys -- and earn
://www.scipy.org/Numpy_Example_List ) are a good start.
A. M. Archibald
-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT business topics
slower than fancy indexing, so the way to do this one is
just to use a for loop.
A. M. Archibald
-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
(for cache coherency in a)
This seems like a rather common operation - I know I've needed it on
at least two occasions - is it worth creating some sort of C
implementation? What is the appropriate generalization?
A. M. Archibald
time an index comes up we want to add the value to what's there,
rather than replacing it. I suppose histogram covers one major
application; in fact if histogram allowed weightings (count this
point as -0.6) it would solve the OP's problem.
A. M. Archibald
? (cough, Numeric compatibility, cough)
Would it be of interest to have numeric datatypes integrated with
python datatypes? How about IEEE floats in python proper, at least? It
can be rather confusing when doing a calculation yields different
results for arrays than for ordinary scalars...
A. M
hasn't been released yet...
A. M. Archibald
-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere
of polynomials - X^n,
(X-a)^n, orthogonal polynomials (translated and scaled as needed),
what have you.
I think I vote for polyfit that is no more clever than it has to be
but which warns the user when the fit is bad.
A. M. Archibald
to numerical
instabilities.
In any case, all this is outside the purview of numpy (as is polyfit, frankly).
A. M. Archibald
-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly
), as is Scientific Python (and numpy,
Numeric and numarray are obviously already confusing).
A. M. Archibald
-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology
On 14/10/06, Charles R Harris [EMAIL PROTECTED] wrote:
On 10/13/06, A. M. Archibald [EMAIL PROTECTED] wrote:
On 13/10/06, Tim Hochberg [EMAIL PROTECTED] wrote:
Charles R Harris wrote:
snip
On the other hand if error handling is set to 'raise', then a
FloatingPointError is issued
want.
A. M. Archibald
-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1
On 18/10/06, Charles R Harris [EMAIL PROTECTED] wrote:
On 10/17/06, A. M. Archibald [EMAIL PROTECTED] wrote:
On 17/10/06, Charles R Harris [EMAIL PROTECTED] wrote:
On 10/17/06, Travis Oliphant [EMAIL PROTECTED] wrote:
Thus, reshape does the equivalent of a Fortran ravel
python's in-place operators:
M += 1
M *= 2
This is actually a standard difficulty people have with python, made
more obvious because you're working with mutable arrays rather than
immutable scalars.
A. M. Archibald
-
Using
copies in PyArray_NewShape unless absolutely necessary.
A. M. Archibald
-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
-dimensional distributions
differ? at http://www.nrbook.com/a/bookcpdf.html is one) but it's not
clear how to turn the problem you describe into a solvable one - some
assumption about how the models vary between sampled x values appears
to be necessary, and that amounts to interpolation.
A. M. Archibald
memory
is accessed. (In C, I'm afraid, but for this sort of thing C is
well-suited.)
A. M. Archibald
-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated
the
correct behaviour...
A. M. Archibald
-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application
On 25/10/06, Travis Oliphant [EMAIL PROTECTED] wrote:
It takes old type-codes as one big string so you say
vectorize(f,otypes='d')
This should be modernized to handle a list of dtype objects.
I've fixed vectorize in SVN.
Thanks!
A. M. Archibald
. Is there a function that will
sort the values and vectors together or do I need to write it myself.
I think that they are sorted, but argsort() will do what you want (or
argmax(), even).
A. M. Archibald
-
Using Tomcat but need
it take to rewrite numpy to use
ctypes? There seems to be some problem with extending the type objects
used by ctypes, but it's not very clear to me what that problem is
(what the extensions are supposed to do).
The argument that *some* datatypes format should become standard is much easier.
A. M
,
A[list(xrange(0,40)] should work fine) isn't necessarily worth the
trouble.
A. M. Archibald
-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology
problematic
to us.
Someone has to say it: you could just drop support for the obsolete
numarray and provide only support for its successor, numpy.
A. M. Archibald
-
Using Tomcat but need to do more? Need to support web services
MaskedScalar).
If you've got floating point, you can again fill in NaNs, but you have
a good point about wanting to extract the original values that were
masked out. Depending on what one is doing, one might want one or the
other.
A. M. Archibald
discrimination against a citizen in good
standing of the IEEE floating point community.
A. M. Archibald
-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated
controllable IEEE floats and
MaskedArray, and I apologize for a basically off-topic post.
A. M. Archibald
-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated
them to the scipy list - it's
always good to build up the library.
A. M. Archibald
-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your
behaviour by taking inf as the
initial value for min and -inf as the first value for max, then
reducing as normal. This would then, depending on how max and min are
implemented, either return NaN if any are present, or return the
smallest/largest non-NaN value (or inf/-inf if there are none)
A. M
On 12/11/06, Keith Goodman [EMAIL PROTECTED] wrote:
Is anybody interested in making x.max() and nanmax() behave the same
for matrices, except for the NaN part? That is, make
numpy.matlib.nanmax return a matrix instead of an array.
Sounds good to me; maybe put a patch in the tracker?
A. M
-precision floating-point format (if one is available on your
machine) before transposing and storing in a record array.
A. M. Archibald
-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done
45 matches
Mail list logo