numpy.frombuffer != unpack() ??

Marlin Rowley marlin_rowley at hotmail.com
Fri May 16 18:15:51 EDT 2008


All:
 
I'm getting different floating point values when I use numpy vs. unpack().
 
frgba = numpy.frombuffer(<string of bytes>, dtype=float32)
buffer = unpack("!f", byte)
 
frgba[0] != buffer[0]
 
why?  This is forcing me use the unpack() function since it's giving me the correct values.  What am I doing wrong?
 
-M
 
 
_________________________________________________________________
Change the world with e-mail. Join the i’m Initiative from Microsoft.
http://im.live.com/Messenger/IM/Join/Default.aspx?source=EML_WL_ChangeWorld
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080516/c26de23b/attachment.html>


More information about the Python-list mailing list