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=lnkkid=120709bid=263057dat=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=lnkkid=120709bid=263057dat=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.phpp=sourceforgeCID=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/ipython console

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.phpp=sourceforgeCID=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.phpp=sourceforgeCID=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('f8'):
   ...:print 'Truth value is no'
   ...:
   ...:
Truth value is no

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.phpp=sourceforgeCID=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.phpp=sourceforgeCID=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/ipython console

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.phpp=sourceforgeCID=DEVDEV
___
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=lnkkid=120709bid=263057dat=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-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=lnkkid=120709bid=263057dat=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=lnkkid=120709bid=263057dat=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
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.phpp=sourceforgeCID=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
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.phpp=sourceforgeCID=DEVDEV
___
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion