On Monday 17 July 2006 12:10, Travis Oliphant wrote: > Sebastian Haase wrote: > > Traceback (most recent call last): > > File "<input>", line 1, in ? > > TypeError: array cannot be safely cast to required type > > > >>>> dd=d.astype(N.float32) > >>>> N.dot(dd,ccc) > > > > [[[ 1. 1. 1.] > > [ 1. 1. 1.] > > [ 1. 1. 1.]] > > > > [[ 2. 2. 2.] > > [ 2. 2. 2.] > > [ 2. 2. 2.]]] > > > > > > > > The TypeError looks like a numpy bug ! > > I don't see why this is a bug. You are trying to coerce a 32-bit > integer to a 32-bit float. That is going to lose precision and so you > get the error indicated. > > -Travis In numarray I do not get an error. Would the error go away if I had 64 bit float !? It seems though that having ones and twos in an int array should fit just fine into a float32 array !?
- Sebastian Haase ------------------------------------------------------------------------- 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