El dl 18 de 09 del 2006 a les 09:38 +0200, en/na Lionel Roubeyrie va
escriure:
> Le vendredi 15 septembre 2006 16:05, Francesc Altet a écrit :
> > Another possibility is to play with columns directly from the initial
> > recarray. The next is an example:
> >
> > In [101]
El dl 18 de 09 del 2006 a les 17:10 +0200, en/na Lionel Roubeyrie va
escriure:
> Le lundi 18 septembre 2006 12:17, Francesc Altet a écrit :
> > You have two problems here. The first is that you shouldn't have missign
> > entries, or conversion from empty strings to int
ong in my count, but
there appear to be only three of such functions in NumPy, namely, argmax,
argmin and argsort. Adding three additional 'combos' doesn't seem a lot to my
mind, but it can be just 'too much' for more common sense minds.
Cheers,
--
>0,0< F
A Dimarts 19 Setembre 2006 19:21, Charles R Harris va escriure:
> On 9/19/06, Francesc Altet <[EMAIL PROTECTED]> wrote:
> > A Dimarts 19 Setembre 2006 07:18, Charles R Harris va escriure:
> > > I note that argsort also produces indexes that are hard to use in the
> >
d NumPy
enumerated types, like:
numpy.int32 --> NPY_INT
numpy.int64 --> NPY_LONGLONG
numpy.int_ --> NPY_LONG
in all platforms, avoiding the current situation of ambiguous mapping between
platforms.
Sorry for being so persistent, but I think the issue is worth it.
--
>0,0< Fran
lace sort() immediately after an argsort()
operation is very efficient (cache effects here?), and would avoid the need
of the combo function (from the point of view of efficiency, I repeat).
Cheers,
--
>0,0< Francesc Altet http://www.carabos.com/
V V Cárabos Coop. V. Enjoy Data
&qu
Blame on me. Sorry about any inconveniences and thanks once more for your
patience!
--
>0,0< Francesc Altet http://www.carabos.com/
V V Cárabos Coop. V. Enjoy Data
"-"
-
Take Surveys. Earn Cash.
esult.
In fact, I like this behaviour of NumPy scalars (at least, when I'm
aware of it!), but I thought it would be nice to warn other people about
that.
Cheers,
--
>0,0< Francesc Altet http://ww
27;d', 'Object':
'O', 'UInt8': 'b', 'UInt32': 'u', 'Complex64': 'D', 'UInt16': 'w',
'Bool': 'B', 'Complex32': 'F', 'Int64': 'N', 'Int8&
El dl 25 de 09 del 2006 a les 11:08 -0600, en/na Travis Oliphant va
escriure:
> Francesc Altet wrote:
>
> >Hi,
> >
> >Anybody know if there is a map between NumPy types and Numeric
> >typecodes? Something like 'typecodes' for numarray:
> >
>
a
future.
Cheers,
--
>0,0< Francesc Altet http://www.carabos.com/
V V Cárabos Coop. V. Enjoy Data
"-"
-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay pan
y/ in ()
: function takes exactly 1 argument (0 given)
--
>0,0< Francesc Altet http://www.carabos.com/
V V Cárabos Coop. V. Enjoy Data
"-"
-
Take Surveys. Earn Cash. Influence the Future of IT
Join Sour
umpy.dtype('int32').type
True
So far so good, but is the next the intended behaviour?
>>> numpy.typeDict['i4']
>>> numpy.typeDict['int32']
>>> numpy.typeDict['i4'
El dc 27 de 09 del 2006 a les 10:01 +0100, en/na James Graham va
escriure:
> Francesc Altet wrote:
> > So far so good, but is the next the intended behaviour?
> >
> >>>> numpy.typeDict['i4']
> >
> >>>> numpy.typeDict['int32'
El dc 27 de 09 del 2006 a les 11:01 -0600, en/na Travis Oliphant va
escriure:
> Francesc Altet wrote:
> > Hello,
> >
> > Sorry for being insistent, but I recognize that I'm having a bad time
> > with NumPy data type rational. Is there an explanation for this?:
&g
ossible. Eventually, when you have to start changes that
properly belongs to trunk, then it's time to create the branch, but
meanwhile you can save yourself quite a few syncronization work.
Anyway, it is my pleasure to help finding bugs for NumPy!
--
>0,0< Francesc Altet http://
o base class ndarray.
130 """
--> 131 return array(a, dtype, copy=False, order=order)
132
133 def asanyarray(a, dtype=None, order=None):
: long() argument must be a string or a number,
not 'list'
and the same happens with 'uint64'.
My numpy vers
n't:
In [101]: numpy.ndarray(buffer="a\x00b"*4, dtype="S4", shape=3)
Out[101]:
array([aba, ba, bab],
dtype='|S4')
i.e. it seems like numpy is striping-off NULL chars before building the object
and I don
)
i.e. in an array built from ndarray, the default is that it has to be
read-only?
--
>0,0< Francesc Altet http://www.carabos.com/
V V Cárabos Coop. V. Enjoy Data
"-"
-
Take Surveys. Earn C
; a
>
> '12345123\x00\x00\xc6B34512345'
>
> The original, *immutable* string has been mutated. This could get you
> into real trouble in certain situations.
I see. Thanks for the explanation.
--
>0,0< Francesc Altet http://www.carabos.com/
V V Cárabos Coop
El dv 29 de 09 del 2006 a les 16:27 -0600, en/na Travis Oliphant va
escriure:
> Francesc Altet wrote:
>
> >I see. Thanks for the explanation.
> >
> >
> You deserve the thanks for the great testing of less-traveled corners of
> NumPy. It's exactly the kind
ther an object is a
numpy scalar or a python one?
Thanks,
--
>0,0< Francesc Altet http://www.carabos.com/
V V Cárabos Coop. V. Enjoy Data
"-"
-
Take Surveys. Earn Cash. Influence the Future of IT
J
ray([1, 1, 2, 3, 4, 5, 6, 7, 8, 1])
[be sure to use parentesizes appropriately]
Cheers,
--
>0,0< Francesc Altet http://www.carabos.com/
V V Cárabos Coop. V. Enjoy Data
"-"
-
Take Surveys.
great news :-)
Cheers!
--
>0,0< Francesc Altet http://www.carabos.com/
V V Cárabos Coop. V. Enjoy Data
"-"
-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay pan
to use the boolean binary operators (and not the
logical operators) for doing this:
>>> a[(a>2) & (a<8)]
Notice the parenthesis. They are necessary because the operator & has
more precedence than < or >.
--
>0,0< Francesc Altet http://www.carabos.com/
V V
ave a way of testing a recently built version of
numpy prior to install it.
Thanks,
--
>0,0< Francesc Altet http://www.carabos.com/
V V Cárabos Coop. V. Enjoy Data
"-"
"Be careful about using the followi
A Divendres 13 Octubre 2006 22:20, Lisandro Dalcin va escriure:
> On 10/13/06, Francesc Altet <[EMAIL PROTECTED]> wrote:
> > Is it possible to test a numpy version directly from the source
> > directory without having to install it?
>
> I usually do:
>
> $ python s
to access the pointer to data in memory. However, I lack experience in buffer
protocol, so suggestions for achieving this are welcome.
If there is some other trivial way that I haven't devised (specially if usable
from pyrex), please tell me about.
TIA,
--
>0,0< Francesc Alt
d **)&buffer, &buflen)
Oh, this one seems pretty easy, and as a plus, you don't have to book memory
for copying the data area, so I'll use it.
Thanks,
--
>0,0< Francesc Altet http://www.carabos.com/
V V Cárabos Coop. V. Enjoy Data
"-"
--
ut[31]:True
Perhaps raising an error saying something like "boolean types cannot be
compared" would be nice. Not too important, but worth to notice, IMO.
--
>0,0< Francesc Altet| Be careful about using the following code --
V V Carabos Coop. V. | I've only proven th
can be more) is using ndarray:
In [47]: a=numpy.array([1,2,3], dtype="i4")
In [48]: n=1# the position that you want to share
In [49]: b=numpy.ndarray(buffer=a[n:n+1], shape=(), dtype="i4")
In [50]: a
Out[50]: array([1, 2, 3])
In [51
elopment skills, since due to my ignorance in that area
> I cannot even appreciate it fully.)
>
> Thanks, and relax a little after all the hard work!
Yeah, I completely agree. Congratulations to Travis and all the NumPy
team.
Long life to NumPy!
--
Francesc Altet| Be careful abou
erted to float64.
Yes, I think the behaviour is intended. This is because 'float64' is the
default type in NumPy from some months ago (before the default was 'int_')
HTH,
--
>0,0< Francesc Altet http://www.carabos.com/
V V Cárabos Coop. V. Enjoy Data
"-&qu
but now they all generate a "TypeError: data type not understood". Why?
Should be intended as well. If you try to set a dtype from a list, it has to
follow the format of a description as specified in:
http://numpy.scipy.org/array_interface.shtml
for example:
In [67]: dtype([('f1
ve taken the freedom to add some examples of nested types
and recarrays.
--
Francesc Altet| Be careful about using the following code --
Carabos Coop. V. | I've only proven that it works,
www.carabos.com |
El dt 31 de 10 del 2006 a les 23:38 +, en/na George Sakkis va
escriure:
> Is there a more elegant and/or faster way to read some records from a
> file and then sort them by different fields ? What I have now is too
> specific and error-prone in general:
>
> import numpy as N
> records = N.from
e
> (records.sort('f1') doesn't work unfortunately), that would be perfect.
Yes, I agree that having the possibility to do records.sort('f1') would
be a great addition (both in terms of usability but also efficiency).
Cheers,
--
Francesc Altet| Be careful about using the
n the end,
it is a very good piece of software) in PyTables, but don't having a
solution for this problem anytime soon, will make this very problematic
to us.
Thanks,
--
Francesc Altet| Be careful about using the following code --
Carabos Coop. V. | I've only proven
tp_repr (typeobject.c:4504)
it seems to my inexpert eyes that the compiler has generated some code
that it is not understood by the amd64 architecture (?).
[1]
<http://sourceforge.net/tracker/index.php?func=detail&aid=1565683&group_id=1369&atid=45
on 2.5 and 64-bit
platforms (or, at very least, Linux64 on top of AMD64 :P) can lend to
pretty scaring results.
Cheers,
--
>0,0< Francesc Altet http://www.carabos.com/
V V Cárabos Coop. V. Enjoy Data
"-"
--
A Dijous 02 Novembre 2006 22:26, A. M. Archibald escrigué:
> On 02/11/06, Francesc Altet <[EMAIL PROTECTED]> wrote:
> > I see this as a major issue in numarray and poses in great danger the
> > intended support of PyTables for numarray that we planned for some time
> &
: b.extend([float(n) for n in line.split()])
:
In [66]: A=numpy.array(a).reshape(2,2); B=numpy.array(b).reshape(2,2)
In [67]: A, B
Out[67]:
(array([[ 1., 2.],
[ 3., 9.]]),
array([[ 2., 3.],
[ 4., 4.]]))
HTH,
--
>0,0< Francesc Altet htt
,
>[3, 9]])
>
> In [12]: b
> Out[12]:
> array([[2, 3],
> [4, 4]])
Yeah. Much, much better indeed.
--
>0,0< Francesc Altet http://www.carabos.com/
V V Cárabos Coop. V. Enjoy Data
"-"
-
.org
in particular, try:
arctan site:www.scipy.org
Cheers,
--
>0,0< Francesc Altet http://www.carabos.com/
V V Cárabos Coop. V. Enjoy Data
"-"
-
Using Tomcat but need to do more? Need to suppor
27;formats':('S1','f4',
'f4')}").repeat(3,10)
Out[51]:[0.44204592704772949, 0.43584394454956055, 0.50145101547241211]
In [52]:Timer("numpy.array([tuple(row) for row in results],
dtype=my
quot;setup SQLite took", t1-t0, "seconds"
t0 = time.time()
y1 = retrieveSQLite(conn)
t1 = time.time()
print "retrieve SQLite took", t1-t0, "seconds"
conn.close()
fileh = pt.openFile("test.h5", "w"
in NumPy would
be nice. Also working in introducing a simple array class in Python core and
using the array protocol to access the data would be very good.
Cheers,
--
>0,0< Francesc Altet http://www.carabos.com/
V V
will finally encourage people to always use dot.
So, why not issuing a DeprecationWarning on a matrixmultiply function use?
--
>0,0< Francesc Altet http://www.carabos.com/
V V Cárabos Coop. V. Enjoy Data
"-"
___
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion
should be the difference of representation of longs in
32-bit and 64-bit platforms, isn't it?
Cheers,
--
>0,0< Francesc Altet http://www.carabos.com/
V V Cárabos Coop. V. Enjoy Data
"-"
___
Numpy-di
t in our local copy of numexpr,
so perhaps (I say perhaps because we are in the middle of a big project now
and are a bit scarce of time resources) we can provide the patch against the
latest version of David for your consideration. With this we can solve the
problem with int64 support in 32-bit
A Dimarts 13 Juny 2006 19:47, Francesc Altet va escriure:
> > - Support for both numpy and numarray (use the flag --force-numarray
> > in setup.py).
> >
> > At first glance this looks like it doesn't make things to messy, so I'm
> > in favor of incor
you can't even
cast it to any other commonly available datatype (casting to a float64 will
also loose precision). And, although you can afford loosing precision when
dealing with floating data in some scenarios (but not certainly with a
general-purpose library like numexpr tries to be
addresses as ints/longs.
Very interesting. So, may I suggest to use this capability to represent
addresses? I think this would simplify things (specially it will prevent to
use ascii/pointer conversions, which are ugly to my mind).
Cheers,
--
>0,0< Francesc Alt
sted1']['nested2']['nested3'].
In the same way, elements of 'nested2' field could be accessed by:
tr.fields['nested1']['nested2'][2:10:2].
5. Finally, you can even prevent setting or deleting columns by
disabling the __setattr__ and __delattr__
g would be much appreciated! Here is the
> message I get trying to run f2py:
>
Mmm, perhaps you can try with putting:
[build]
compiler=mingw32
in your local distutils.cfg (see
http://docs.python.org/inst/config-syntax.html)
HTH,
--
>0,0< Francesc Altet http://w
===
Announcing PyTables 1.3.2
===
This is a new minor release of PyTables. There you will find, among
other things, improved support for NumPy strings and the ability to
create indexes of NumPy-flavored tables (this capability was broken in
earlier
ecise this point.
>
> Please, give some comments. Thanks.
Done ;-)
--
>0,0< Francesc Altet http://www.carabos.com/
V V Cárabos Coop. V. Enjoy Data
"-"
-
Using Tomcat but need to do mor
than
the second (i.e. using a past release version in SVN) because I tend to find
it slightly less confusing.
However, I think that if you choose whatever convention consistently, people
will get used to it and everything will be fine.
--
>0,0<
ink this is a relatively important problem, because it somewhat prevents a
smooth transition from numarray to NumPy.
Thanks,
--
>0,0< Francesc Altet http://www.carabos.com/
V V Cárabos Coop. V. Enjoy Data
"-"
-
t; No, I'm not even sure why exactly that was written but it's just in the
> testing code.
I think this is my fault. Some months ago I contributed some testing code for
checking numerical types, and ended with thi
obj)
> Py_XDECREF(a->base)
> a->base = obj
> Py_DECREF(cobj)
>
> Thanks Travis!
Hey! I checked this morning Travis' patch and seems to work well for me. I'll
add yours as well later on and see... BTW, where exactly I've to add the
above lines?
Many thank
also wanted to thanks (once
more), the excellent work of the NumPy crew, and specially Travis for their
first-class work.
Thanks!
--
>0,0< Francesc Altet http://www.carabos.com/
V V Cárabos Coop. V. Enjoy Data
"-"
packages of public releases, that's all.
Cheers,
--
>0,0< Francesc Altet http://www.carabos.com/
V V Cárabos Coop. V. Enjoy Data
"-"
-
Using Tomcat but need to do more? Need to support web
pened to check
everything, look at online docstrings and be able to do fast timings added
the "cerise sur le gâteau".
Luck!
--
>0,0< Francesc Altet http://www.carabos.com/
V V Cárabos Coop. V. Enjoy Data
"-"
--
===
Announcing PyTables 1.3.3
===
I'm happy to announce a new minor release of PyTables. In this one, we
have focused on improving compatibility with latest beta versions of
NumPy (0.9.8, 1.0b2, 1.0b3 and higher), adding some improvements and the
ty
more).
I'm personally an addict to encapsulate as much functionality as possible in
methods (but perhaps I'm biased by an insane use of TAB in ipython console).
Cheers,
--
>0,0< Francesc Altet http://www.carabos.com/
V V Cárabos Coop. V. Enjoy Data
"-"
transition.
Thanks,
--
>0,0< Francesc Altet http://www.carabos.com/
V V Cárabos Coop. V. Enjoy Data
"-"
-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done
A Dissabte 26 Agost 2006 13:42, Bill Baxter va escriure:
> On 8/26/06, Francesc Altet <[EMAIL PROTECTED]> wrote:
> > I'm personally an addict to encapsulate as much functionality as possible
> > in
> > methods (but perhaps I'm biased by an insane use of TAB
Intel). On its hand, fancy indexing seems to use an iterator and
copying the elements one-by-one seems faster. I'd say that replacing memmove
by memcpy would make .take() much faster.
Regards,
--
>0,0< Francesc Altet http://www.carabos.com/
V V Cárabos Coop. V. Enjoy D
aise ImportError, "ctypes is not available."
> ImportError: ctypes is not available.
This may be due to the fact that you are using Python 2.4 here and ctypes
comes with Python2.5. Switch to 2.5, install ctypes separately or feel free
to ignore this.
I suppose that a check has t
y other reference to it) and the new object
will be bound to B.
If what you want is to avoid having in memory the three objects (namely
A, old B and new B) at the same time, you can do something like:
del B # deletes reference t
El dt 12 de 09 del 2006 a les 13:17 -0400, en/na Pierre Thibault va
escriure:
> Hello again,
>
> On 9/12/06, Francesc Altet <[EMAIL PROTECTED]> wrote:
> > Hello Pierre,
> > [...]
> >
> > Well, in some way, there is a temporary array creation that is
> &g
tead of one) perhaps the former is causing the OS
to start swapping. However a quick look with top at the processes, says
that both [1] and [2] takes similar amounts of memory (~ 170 MB peak)
and, as arrays take 64 MB each, in both cases the used memory seems
higher than the required at first sight. Mm
epresentation for
types ('Int32', 'Complex64'...) and looking at how NumPy represents it
now, I'd say that this is a backwards step in readability. Something
like '0,0< Francesc Altet http://www.carabos.com/
V V Cárabos Coop. V. Enjoy Data
"-"
py.array([1])
In [3]:a.data
Out[3]:
although I'm not sure which number is the memory address I'd say it's
the last one.
Cheers,
--
>0,0< Francesc Altet http://www.carabos.com/
V V Cárabos Coop. V. Enjoy Data
"-"
-
y("1"*36, dtype="a4,i4,f4", shape=3)
In [102]: ra
Out[102]:
recarray([('', 825307441, 2.5784852031307537e-09),
('', 825307441, 2.5784852031307537e-09),
('', 825307441, 2.5784852031307537e-09)],
dtype=[(
oblems.
> Is there a way to force alignment or to get trailing unused bytes in the
> dtpye?
One possible solution is to declare void ('V' charcode) types for filling the
gaps. For example:
In [118]: ra=numpy.rec.array("1"*300, dtype=[('sval','0,0
77 matches
Mail list logo