Joining data from three different files to be written into three Columns

Dawn Abbott whiterabbott at gmail.com
Wed Nov 29 23:11:35 EST 2006


No, two of the binary data files are integers and the third file is a
float.  The data is large and the binary saves time and space.


On 11/29/06, Gabriel Genellina <gagsl-py at yahoo.com.ar> wrote:
>
> At Wednesday 29/11/2006 23:07, Dawn Abbott wrote:
>
> >I have three files of binary data.  I want to write the three binary
> >data files to one file.  I want the old files to each have their own
> >column in the new file.  This is what I have,
> >
> >f=open('relative_x.INT32','rb')
> >a=array('l')
> >a.fromfile(f,10)
> >g=open('relative_y.INT32','rb')
> >b=array('l')
> >b.fromfile(g,10)
> >data=zip(a,b)
> >for datum in data:
> >...    print ' '.join(datum)
> >...
> >
> >
> >the error I get is expected string, found int
> >I figure that the joint is for strings only does anyone know of a
> >way were I could join the data that would be for ints.
>
> Do you want to write a TEXT representing the binary values?
>
> for datum in data:
>      print ' '.join(map(str,datum))
>
>
> --
> Gabriel Genellina
> Softlab SRL
>
> __________________________________________________
> Correo Yahoo!
> Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
> ¡Abrí tu cuenta ya! - http://correo.yahoo.com.ar
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20061129/e78826a1/attachment.html>


More information about the Python-list mailing list