Re: [Numpy-discussion] Passing numpy arrays to matlab

2006-11-07 Thread Matthew Brett
Hi,

> Thank you very much, I think this added documentation is pretty recent;
> I have never seen it before, and I did a lot a mex programming at some
> point... This whole mxarray nonsense reminds me why I gave up on matlab :),

I would be very happy to help with this.  It would be great if we
could get a standard well-maintained library of some sort towards
scipy - we (http://neuroimaging.scipy.org/) have a great deal of
matlab integration to do.

Best,

Matthew

-
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 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion


[Numpy-discussion] dtype.hasobject value

2006-10-30 Thread Matthew Brett
Hi,

I notice that the value for:

zeros((1,), dtype=object).dtype.hasobject

is now 63, whereas previously it had been 1.  Is this intended?

Thanks,

Matthew

-
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 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion


[Numpy-discussion] Numpy types and object comparison

2006-10-07 Thread Matthew Brett
Hi,

I am sorry, I am still struggling with object arrays - and here -
numpy data types.  Is there any easy way to explain why comparisons
with numpy types give a different output from comparisons with
non-numpy types:

In [108]:oa = zeros((1,), dtype=object)

In [109]:oa == int
Out[109]:array([False], dtype=bool)

In [110]:oa == int32
Out[110]:False

Many thanks for your patience,

Matthew

-
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 cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion


Re: [Numpy-discussion] flat indexing of object arrays

2006-10-05 Thread Matthew Brett
Hi,

On 10/5/06, Martin Wiechert <[EMAIL PROTECTED]> wrote:
> Hi list,
>
> when I try to assign a sequence as an element of an object array via flat
> indexing only the first element of the sequence is assigned:

I've also been having trouble with flat on object arrays.

Is this intended?

In [1]: from numpy import *

In [2]: a = arange(2)

In [3]: a[1]
Out[3]: 1

In [4]: a.flat[1]
Out[4]: 1

In [5]: b = array([a], dtype=object)

In [6]: b[1]
---
exceptions.IndexErrorTraceback (most
recent call last)

/home/mb312/devel_trees/scipy/Lib/io/

IndexError: index out of bounds

In [7]: b.flat[1]
Out[7]: 1

Best,

Matthew

-
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 cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion


[Numpy-discussion] Downcasting to smallest storage

2006-09-25 Thread Matthew Brett
Hi,

I am sorry if I have missed anything obvious here, but is there a fast
simple way to downcast an array to the smallest storage that hold
array data within a specified precision  - e.g.

a = array([1.0])
small_a = fantasy_function(a, rtol=1.0001e-05, atol=1e-08 )
b = array([1.2])
small_b = fantasy_function(b, tol=1.0001e-05, atol=1e-08)

where a.dtype becomes, say, uint8, and b.dtype becomes float32?

Thanks a lot,

Matthew

-
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 cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion


Re: [Numpy-discussion] dtype truth value

2006-09-23 Thread Matthew Brett
> So, you can think of the test as
>
> if dtype(...):
>print "Data-type has fields:"
> else:
>print "Data-type does not have fields:"

Thank you as ever for your very clear and helpful explanation,

Best,

Matthew

-
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 cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion


[Numpy-discussion] dtype truth value

2006-09-23 Thread Matthew Brett
Hi,

Forgive my ignorance, but why is this?

In [1]:from numpy import *

In [2]:if not dtype('http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion


Re: [Numpy-discussion] arr.dtype.kind is 'i' for dtype=unit !?

2006-09-21 Thread Matthew Brett
Hi,

> It's in the array interface specification:
>
> http://numpy.scipy.org/array_interface.shtml

I was interested in the 't' (bitfield) type - is there an example of
usage somewhere?

In [13]: dtype('t8')
---
exceptions.TypeError Traceback (most
recent call last)

/home/mb312/python/

TypeError: data type not understood

Best,

Matthew

-
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 cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion


Re: [Numpy-discussion] Resolution of tickets.

2006-09-19 Thread Matthew Brett
Hi,

> > You have to be logged in to the Trac site.  If you have SVN write access
> > you should be able to log in.  Then there is a "resolution" section at
> > the very bottom.
>
> Ah,  that works. I orignally tried to register and discovered that charris
> was already taken and I didn't know what password to use. I've now deleted
> the charris208 account.

Not for me, when logged on with my SVN username.   I took Robert's
email to mean we needed specific permission (over and above SVN write
access) to resolve tickets - is that not the case?

Best,

Matthew

-
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 cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion


[Numpy-discussion] Segfault on byteswap() on recarrays

2006-09-18 Thread Matthew Brett
Hi,

I noticed this works:

In [5]:a = array((1,), dtype=[('one', 'http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion


[Numpy-discussion] Changing byte ordering with astype fails with 0d arrays

2006-09-18 Thread Matthew Brett
Hi,

As expected:

In [67]:a = array([1], dtype='i4').dtype
Out[68]:dtype('>i4')

I was also expecting this to work for 0d arrays, but it doesn't:

In [69]:a = array(1, dtype='i4').dtype
Out[70]:dtype('http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion


Re: [Numpy-discussion] Problem with concatenate and object arrays

2006-09-13 Thread Matthew Brett
Hi,

> For example, if you do array([a,b,c]).shape(), the answer is normally
> (3,) unless a b and c happen to all be lists of the same length, at
> which point your array could have a much more complicated shape... but
> as the person who wrote "array([a,b,c])" it's tempting to assume that
> the result has shape (3,), only to discover subtle bugs much later.

Very much agree with this.

> If we were writing an array-creation function from scratch, would
> there be any reason to include object-array creation in the same
> function as uniform array creation? It seems like a bad idea to me.
>
> If not, the problem is just compatibility with Numeric. Why not simply
> write a wrapper function in python that does Numeric-style guesswork,
> and put it in the compatibility modules? How much code will actually
> break?

Can I encourage any more comments?  This suggestion seems very
sensible to me, and I guess this is our very last chance to change
this. The current behavior does seem to violate least surprise - at
least to my eye.

Best,

Matthew

-
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 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion


[Numpy-discussion] iscomplex on strings

2006-09-13 Thread Matthew Brett
Hi,

I was surprised by this - but maybe I shouldn't have been:

In [7]:iscomplex('a')
Out[7]:True

In [8]:iscomplex(u'a')
Out[8]:True

Best,

Matthew

-
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 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion


Re: [Numpy-discussion] Problem with concatenate and object arrays

2006-09-05 Thread Matthew Brett
Hi,

> This is a result of PyArray_FromAny changing when object arrays are
> explicitly requested (which they are in this case --- although behind
> the scenes).

Hmm - I think I am hitting a related bug/feature/surprising change in
behavior, which is showing up rather obscurely in a failure of the
scipy.io matlab loading tests:

http://projects.scipy.org/scipy/scipy/ticket/258

Here's the change I wasn't expecting, present with current SVN:

a = arange(2)
b = arange(1)
c = array([a, b], dtype=object)
c
->
array([[0, 1],
   [0, 0]], dtype=object)

On a previous version of numpy (1.02b.dev2975) I get the answer I was expecting:

array([[0], [0 1]], dtype=object)

Best,

Matthew

-
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 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion


[Numpy-discussion] Creating and reshaping fortran order arrays

2006-08-14 Thread Matthew Brett
Hi,

I am sorry if this is obvious, but:

I am working on the scipy loadmat module, and would like to use numpy
to reformat the fortran order arrays that matlab saves.  I was not
sure how to do this, and would like to ask for advice.

Let us say that I have some raw binary data as a string.  The data
contains 4 integers, for a 2x2 array, stored in fortran order.

For example, here is 0,1,2,3 as int32

str = '\x00\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00'

What is the best way of me putting this into a 2x2 array object so
that the array recognizes the data is in fortran order.  Sort of:

a = somefunction(str, shape=(2,2), dtype=int32, order='F')

such that a.shape = (2,2) and a[1,0] == 1, rather than 2.

Sorry if that's obvious, but I couldn't see it immediately

Thanks a lot,

Matthew

-
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 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion


[Numpy-discussion] astype char conversion

2006-08-08 Thread Matthew Brett
Hi,

Sorry if this is silly question, but should this work to convert from
int8 to character type?

a = array([104, 105], dtype=N.int8)
a.astype('|S1')

I was a bit surprised by the output:

array([1, 1],
  dtype='|S1')

Thanks a lot,

Matthew

-
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 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion


Re: [Numpy-discussion] numpy vs numarray

2006-07-31 Thread Matthew Brett
Oh dear, I hope my friends remind me never to let anyone record what I
say when I give a class!

-
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 cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion


Re: [Numpy-discussion] numpy vs numarray

2006-07-31 Thread Matthew Brett
On 7/31/06, Robert Kern <[EMAIL PROTECTED]> wrote:
> Louis Cordier wrote:
> > Hmmm, I think people are spreading "fud" (lower case)...
> > http://media.libsyn.com/media/awaretek/Python411_060530_Numeric.mp3
>
> Can you give us a synopsis? or point us to when exactly in the clip we're
> supposed to listen?

Er, I didn't listen to the whole thing, but there are some references
to numpy being difficult to install under platforms other than windows
(arguable I guess), I got the impression the speaker was conflating
the enthon distribution with scipy, and he says at one point that
numarray is the successor to numpy.   Not fud exactly, but a bit
misleading.

Matthew

-
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 cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion


[Numpy-discussion] ERROR: check_singleton

2006-07-31 Thread Matthew Brett
Hi,

Just in case this was new information:

==
ERROR: check_singleton (numpy.lib.tests.test_getlimits.test_longdouble)
--
Traceback (most recent call last):
  File "/usr/lib64/python2.4/site-packages/numpy/lib/tests/test_getlimits.py",
line 33, in check_singleton
ftype = finfo(longdouble)
  File "/usr/lib64/python2.4/site-packages/numpy/lib/getlimits.py",
line 49, in __new__
obj = object.__new__(cls)._init(dtype)
  File "/usr/lib64/python2.4/site-packages/numpy/lib/getlimits.py",
line 75, in _init
'numpy %s precision floating point number' % precname)
  File "/usr/lib64/python2.4/site-packages/numpy/lib/machar.py", line
210, in __init__
raise RuntimeError
RuntimeError

numpy 1.0b2.dev2927
FC4_64 on intel.

Best,

Matthew

-
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 cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion


Re: [Numpy-discussion] Time for beta1 of NumPy 1.0

2006-06-30 Thread Matthew Brett
Just one more vote for float.

On the basis that Travis mentioned, of all those first-timers
downloading, trying, finding something they didn't expect that was
rather confusing, and giving up.

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 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion