like:
temp = x[i].copy()
x[i], x[j] = x[j], temp
work?
In any case, it should raise an error if ndim > 1, rather than giving a
wrong result.
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959 voice
7600 Sand Poin
py semantics.
It truth, this means:
1) numpy arrays
2) standard python mutable sequences
But it does satisfy the duck typing approach.
Maybe we could specifically check for copy vs. view semantics, but that
seems like overkill.
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Res
x27;TEM', '>f4')])
>>> a[0]['Dates'] = datetime.datetime(2006,11,29)
>>> a[0]['HUM'] = 2
>>> a[0]['TEM'] = 3
>>> a
array([(datetime.datetime(2006, 11, 29, 0, 0), 2.0, 3.0), (None, 0.0,
0.0)], dtype=[('Dates'
Torgil Svensson wrote:
> It works if you replace the strings '2','3','5','6' with numbers instead.
duh! I can't believe I didn't see that!
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R
array)
Personally, I liked it that way -- if you can't do a rich comparison, an
error is better than a meaningless result.
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959 voice
7600 Sand Point Way NE (206)
Robert Kern wrote:
> Well, it's consistent with all of the other coercion rules:
>
>
> In [6]: (array(5.0, dtype=float32) + 0).dtype
> Out[6]: dtype('float64')
duh! of course. If I use a float32 scalar for BOTH the operands, then I
get a float32 array out. Tha
known error, that has to do with 64 bit G5 issues , and
IIRC, it's a test error, not a real bug.
Good luck!
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seatt
or("cannot handle data-type")
> typestr = typestr[:2]
> if typestr == 'i4':
> ...
>
> The error is that 'typestr = typestr[:2]' should instead be 'typestr
> = typestr[1:]'
that code was contributed by the numpy develo
on:
b = where(a > 0, 10, 0)
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
[EMAIL PROTECTED]
__
> Numpy-discussion mailing list
> Numpy-discussion@scipy.org
> http://projects.scipy.org/mailman/listinfo/numpy-discussion
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959 voic
the row you've just calculated
ir=ir+nstep+1
print lev2
I may have got some of the indexing wrong, but I hope you get the idea.
By the way, if you sent a complete, runnable sample, we can test out
suggestions, and you'll get better answers.
-Chris
--
Christopher Barker, Ph.D
nd Apple supplies LAPACK/BLAS
libs with the system. As for distributing it, the archive at:
pythonmac.org/packages
takes submissions from anyone -- just send a note to the pythonmac list
-- that list is a great help in figuring out how to build stuff too.
-Chris
--
Christopher Barker,
default with generic LAPACK
(kind of like numpy), and put installers built that way up on the web,
along with instructions for those that want to re-build and optimize?
For that matter, is it possible (let's say on Windows) to deliver SciPy
with a set of multiple dlls for LAPACK/BLAS, an
abulous, they do tend to stay
behind the bleeding edge a fair bit -- it would be nice to have the core
packages with the latest and greatest on Windows and Linux too, all as
one easy installer. (or rpm or .deb or whatever for Linux)
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Em
I'm not sure what else was is in libf2c.
In fact, I've often wondered why scipy doesn't use f2c.
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seat
I just discovered the:
Scipy Superpack for OS X
http://trichech.us/?page_id=4
Maybe this will help folks looking for an OS_X Scipy build.
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959 voice
7600 Sand Point Wa
ely)
5) Put all that up on pythonmac.
I'd like to do it, but I'm not the least bit sure when I'll be able to--
someone please beat me to it!
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (2
ct me if I'm got a wrong (or
outdated) impression.
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
__
y that I can query to
see if it fits what I'm expecting.
Have I got that right?
If so, this would be great.
By the way,, how compatible is this with the existing buffer protocol?
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R
now, I suppose -- very nice.
Another question -- is this new approach in response to feedback from
Guido and or other Python devs? This sure seems like a good way to go --
though it seems from the last discussion I followed at python-dev, most
of the devs just didn't get how useful this wo
ys do:
for i in dir(N):
if "nan" in i: print i
>>> import numpy as N
>>> for i in dir(N):
... if "nan" in i: print i
...
isnan
nan
nan_to_num
nanargmax
nanargmin
nanmax
nanmin
nansum
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergenc
f code to use the array interface in
PIL, but he seemed skeptical of the idea.
Perhaps lobbying (or even just surveying) some of these folks would be
useful.
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959 voice
Travis Oliphant wrote:
> Christopher Barker wrote:
>> wxPython -- Robin Dunn
>> PIL -- Fredrik Lundh
>> PyOpenGL -- Who?
>> PyObjC -- would it be useful there? (Ronald Oussoren)
>> MatplotLib (but maybe it's already married to numpy...)
>> PyG
y (on without .src. in the name)for
your system.
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
__
> data back and forth.
That's the biggest issue, but I think a lot of us use a lot of small
arrays as well -- and while I don't know if it's a performance hit worth
worrying about, it's always bugged me that is is faster to convert to a
python list, then pass i
o You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
> ___
> Numpy-discussion mailing list
> Numpy-discussion@scipy.org
> http://projects.scipy.org/mailman/listinfo/numpy-discussion
-
ates themselves.
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
[EMAIL PROTECTED]
#include "Python.h"
#include "Nu
way to go. If anyone needs other cases optimized, that can be
added later.
I'd still like to know if anyone knows how to efficiently loop through
all the elements of a non-contiguous array in C.
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&
etter than never."
Tells me that we should just focus on the array data structure for the
PEP now.
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329
fset. Ugly and slow.
> Now, it is exposed in the concept of an array iterator. Anybody
> can take advantage of it as it there is a C-API call to get an array
> iterator from the array
Is this iterator as efficient as incrementing the index for contiguous
arrays? i.e. is there any po
up on pythonmac.org/packages.
I'm pretty sure they are linked against wxPython2.6.3.3 (which is also
there).
Maybe you should try those, and if you're still having problems, move
this over to the MPL or pythonmac lists -- it's not a numpy issue.
-Chris
--
Christophe
ncs (like log() ) take an optional parameter that is the array
you want the output to go to. If you pass in the same array, the
operation happens in place.
By the way, it looks like your first column is an index number. As The
array structure keeps track of that for you, you might just as wel
Gary Ruben wrote:
> One question, which may be an issue: Should ones, zeros and empty be
> generating arrays of floats by default now?
>>> import numpy as N
>>> N.ones((3,)).dtype
dtype('float64')
>>> N.zeros((3,)).dtype
dtype('float64')
Travis Oliphant wrote:
> I'm trying to help out the conversion to NumPy by offering patches to
> various third-party packages that have used Numeric in the past.
Travis, you are amazing! Thanks for doing this.
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Respon
ures in numpy: record arrays, in=place byteswap, fromfile.
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
[EMAIL PROTECTED]
___
William Hughes wrote:
> Hi:
> Is there a easy and efficient way to convert between
> Numeric and numpy arrays?
sure is:
Numeric.asarray()
numpy.asarray()
Could it be any easier?
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA
s probably using arrays as a handy and compact n-d data storage
and exchange format. It might be interesting to see how it's really
being used, and if the PEP would meet its needs.
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R
f it changes in the other, but that's one heck of kludge!
>>> a.__array_interface__['data'][0] == b.__array_interface__['data'][0]
True
seems to work, but that's pretty ugly!
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response D
the difference is not in assignment or
anything like that, but in the fact that a list comprehension produces a
copy, which is analogous to :
flipud(a).copy
In numpy, you DO need to be aware of when you are getting copies, and
when you are getting views, and what the consequences are.
So reall
two arrays COULD share data.
I suppose to really be robust, what I'd really want to know is if a
given array shares data with ANY other array, i.e. could changing this
mess something up? -- but I'm pretty sure that is next to impossible
-Chris
--
Christopher Barker, Ph.D.
Oceanog
Hi,
Does anyone know if there will be a SciPy '07 conference, and if so, when?
I'd really like to try to get there this year, but need to start
planning my summer schedule.
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R
Travis Oliphant wrote:
> I'm thinking that we should have several. For example all the fromXXX
> functions should probably be classmethods
>
> ndarray.frombuffer
> ndarray.fromfile
would they still be accessible in their functional form in the numpy
namespace?
--
Chri
handles this by having a few constructors:
wx.EmptyBitmap()
wx.BitmapFromImage()
wx.BitmapFromBuffer()
etc...
but that's kind of clunky too.
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959 voice
7600 Sand Point W
thanks Travis,
Now I just need to remember it's there when I need it!
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-63
6]])
to return:
array([[1, 2],
[3, 4],
[5, 6]])
that's not what I would call a column vector, and if that's what you
want, then what would you want:
MakeColumn([[1,2,3,4],[5,6,7,8]])
to return?
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency
s earlyish in September.
Nice to know. The sooner we get dates, the better, my wife needs to
schedule out summer vacation now!
I've missed it for various reasons for the last 3 years, I hope I can do
this one!
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
N
es will help (I know they can be used to make the
> who function a bit more intelligent about how many bytes are being used).
>
> -Travis
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959 voice
7600 Sand Point Way NE
))
>>> type(s)
>>> s2 = 4 * s
>>> type(s2)
This stayed an array, as, of course, it would have to! I now the whole
"how the heck should a rank-zero array" behave? has been discussed a
lot, but I still wonder if this is how it should be.
Maybe having a whole
his for netcdf4.
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main receptio
> Andre Gosselin (the guy who wrote pycdf) also wrote an interface to HDF4
> (not 5) named pyhdf.
Is he still maintaining these packages? Have you submitted the patches
to him?
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R
use the timeit module.
My results:
Using lists 0.457561016083
Using tostring 0.00922703742981
Using tofile 0.00431108474731
Another note: where is the data coming from -- there may be ways to
optimize this whole process if we saw that.
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Mark Janikas wrote:
> I don't think I can do that because I have heterogeneous rows of
> data I.e. the columns in each row are different in length.
like I said, show us your whole problem...
But you don't have to write.read all the data at once with from/tofile()
anyway. Each of your "rows"
than 1e-16
anyway.
I wonder if there are any C math libs that do a better job than you'd
expect from standard FP? (short of unlimited precision ones)
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959 voice
7600 Sand
Robert Kern wrote:
> Christopher Barker wrote:
>> I wonder if there are any C math libs that do a better job than you'd
>> expect from standard FP? (short of unlimited precision ones)
>
> With respect to π and the zeros of sin() and cos()? Not really. If
> numpy.s
tialized by standard python literals, it would be nice to be able to
do this.
Oh, and here's another inconsistency:
>>> N.int32("676")
676
>>> N.uint32("676")
array([6, 7, 6], dtype=uint32)
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Respons
1,a.shape[1],2)]
>>> b
array([[ 1.+2.j, 3.+4.j],
[ 2.+3.j, 4.+5.j],
[ 4.+5.j, 6.+7.j]])
Is that what you wanted?
By the way, I think there is a trick for doing the every other column
trick without using range(), but I can't find it at the moment.
-Chris
to the PIL config script (a few
> subpackages deep). Is this easy or possible?
I doubt it, but there has got to be a way to tie endianess to platform.
You'd want the Intel code built one way, and the PPC code another. I
think distutils may take care of this for you.
Good luck! And if you fin
taining gcc 4.0.3 with gfortran that looks like
> it
> might be Universal. I haven't tried to build scipy with it, yet.
cool!
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959 voice
7600 Sand Point Way NE (2
There are binaries of 1.0.1 here:
http://pythonmac.org/packages/py24-fat/index.html
and here:
http://pythonmac.org/packages/py25-fat/index.html
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959 voice
7600 Sand Point
Francesc Altet wrote:
> Ops, this seems a bug with your numpy version:
yup, it's a bug here too:
>>> numpy.__version__
'1.0.1'
this is the dmg for python2.5 on pythonmac.org/packages
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NO
ical_and.reduce(equal(a1,a2).ravel())
AttributeError: 'NotImplementedType' object has no attribute 'ravel'
I can use:
>>> numpy.all(a==b)
True
But I was wondering if array_equal should work.
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Di
ing purposes, but I like to do
it for clarities sake.
In MATLAB, there is no such thing as a vector, so you only have the last
two options -- not the first.
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R(206) 526-6
t; try:
> # Using empty array gives an error
> r = rec.fromrecords([], dtype=dt)
> print r
> except IndexError:
> print "Index Error using empty array"
>
> # workaround
> r = array([], dtype=dt).view(recarray)
> print r.name
> ___
ompleteness:
>>> a = N.array(0, dtype=N.float)
>>> b = N.array(0, dtype=N.float)
>>> N.divide(a,b)
Warning: invalid value encountered in divide
nan
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R(206) 526-6
the OP before. It looks like I get
the same as you with the defaults.
There is no NaN for integers, so I guess 0 is as good as anything
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6
duct of the
> fundamental behavior of the matrix class -- which has been explained
> and which you offered no resistance to.
>
> Zach
>
> ___
> Numpy-discussion mailing list
> Numpy-discussion@scipy.org
> http://projects.scipy.o
Numeric LinearAlgebra module with the new numpy;s
arrays. Try this:
>>> from numpy import linalg
>>> sol=linalg.lstsq(A,b)
>>> sol
(array([[ 0.33898305],
[ 2.57627119]]), array([ 0.30508475]), 2, array([ 4.72879916,
1.62433326]))
-Chris
--
Christopher Ba
den by an instance
attribute, then it's clearer to define it as an instance attribute in
the first place:
class A:
def __init___(self, ...)
self.x = 4
Even though it's more typing.
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Divisi
nly for small in-house tools that
we can't point anyone to a web page or anything for.
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (20
versal Framework build of
Python2.5. I'll submit a package to be put on the pythonmac repository.
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206)
MS would supply BLAS/LAPACK.
And aren't they using atlas anyway?
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317
Robert Kern wrote:
> They are, but an older one. There have been significant improvements to the
> Core
> Duo 2 code in ATLAS releases, but no updates to Accelerate.
Let's hope they'll be forthcoming.
Thanks for the update. This may be important to me soon.
-Chris
--
name, or an open file object)
You may want to get fancier with the dtype to force the correct byte order.
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle,
> In fact numpy.fromfile was the first function I tried to use but I
> couldn't manage to get it working with the byteorder I needed
> (big-endian).
a = fromfile(...)
a.byteswap(True)
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R
pect it to work.
-thanks,
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main receptio
Bill Baxter wrote:
> But maybe that's pretty much what may_share_memory does?
I think so. Travis added it after a discussion much like this one on the
list.
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959
:
pythonmac.org/packages
Otherwise, you'll need to tell us more aobut your build environment:
python version (what build, where did you get it?)
OS version
compiler version. (I'd use the latest Xcode distro.)
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emerge
.hypot(v-y) to speed this up more...
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main rec
probably make a temporary v-y,
so you dont' make two of them.
I've been assuming that hypot is written in C, rather than just a
convenience function, but it it's the later, then it won't help here.
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Div
he
files, but you can still use fromfile() or maybe fromstring() to do
this. You just need to read past the text part first, then process it.
using fromstring:
matrix = numpy.vstack([numpy.fromstring(line.split(" ", 1)[1], sep=" ")
for line in vecfile])
or something like th
ven't looked at pylab.load() for a while, but it could
perhaps be sped up by using fromfile() and or fromstring internally.
There may be some opportunity to special case the easy ones too (i.e.
all columns desired, etc.)
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Resp
e.
>>> b[1] = 5
>>> a
array([[ 0., 5., 0.],
[ 0., 0., 0.]])
b and a share data.
if you want to change the shape of a:
>>> a.shape = (6,)
>>> a
array([ 0., 5., 0., 0., 0., 0.])
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emerg
d
idea for methods to sometimes return copies and sometimes views -- it's
begging for subtle bugs!
oh well, either the code or the docstring should change, in any case.
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R(206) 526
.reshape(), so there is a bug of
some sort (probably a doc bug).
if numpy.reshape() is delegating to ndarray.reshape() couldn't they
share docstrings somehow?
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959 vo
e question: why does nonzero() return a tuple with an
array in it, rather than just the array?
Is it so you can so this?
>>> a = numpy.array(((3,0,4),(5,21,0)))
>>> numpy.nonzero(a)
(array([0, 0, 1, 1]), array([0, 2, 0, 1]))
>>> a[numpy.nonzero(a)]
array([ 3, 4,
y more
productive environment for interactive experimentation and quickie
prototypes and scripts, but much less productive for larger projects, or
for people that need to do non-numerical work too.
just my $0.2
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/
is choosing which tool to use!
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
[
stent
code like:
a = array(object, numpy.float32)
b = array(object, numpy.float)
i.e. have it all in the same namespace.
I'm not sure why float_ is an alias for float64, though I'm guessing
it's possible that on some platforms they are not the same.
-Chris
--
Christopher Ba
ut f2py looks very
easy too, if you're working with Fortran.
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA
Is there really no single method to call on an ndarray that asks: "what
endian are you"
I know not every two-liner should be made into a convenience method, but
this seems like a good candidate to me.
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Divisio
mpy.float)
asarray is a no-op if the input is already of the type you've specified
It's handy, as it will take *anything* that can be turned into an array
of the specified type.
This won't work the function needs to change the input in place, however.
-Chris
--
Chri
array(a, dtype=N.float).reshape((-1,))
...print b.shape
...
>>>
>>> test(5)
(1,)
>>> test((5,))
(1,)
>>> test((5,6,7,8))
(4,)
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959 voice
76
;t look like
you can specify a data type with atleast_1d.
I don't think my approach is slower, as it handles the conversion to
float, and reshape doesn't copy the data if it doesn't need to. But I
doubt speed makes any difference here anyway.
-CHB
--
Christopher Barker, Ph.D.
n short, I don't know that this is a bug. It is a missing feature, but
It may be hard to get someone to write the code to account for the
limited fscanf() in fromfile().
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R(206)
's the same compiler as 2.5)
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main recepti
Robert Kern wrote:
> "1.#INF" and "1.#QNAN" might be
> accepted though since that's what ftoa() gives for those quantities.
not in Python:
float("1.#INF")
gives a value error. That may or may not reflect what *scanf does, but I
suspect it doe
tegration at some point
-- it would be nice!
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
or:
a=array([1,2,3]).reshape((-1,1))
Darn, I guess there is more than one obvious way to do it!
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 9
#x27;ve confirmed
> it
> can allocate more than 4GB of memory.
If you use that python to run setup.py, and it's a PPC binary, you
should be all set.
-CHB
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959 voice
7
your options:
http://mail.python.org/mailman/listinfo/pythonmac-sig
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main rece
1 - 100 of 744 matches
Mail list logo