I am working with information from big models, which means I have a lot of big ascii files with two float columns (lets say X and Y). However, whenever I have to read these files it takes a long time, so I thought maybe converthing them to binary files will make the reading process much faster.
I converted my asciifiles into binary files using the uu.encode(ascii_file,binary_file) command, and it worked quite well (Actually, tested the decode part and I recovered the same files).
My question is: is there anyway to read the binary files directly into python and get the data into two variables (x and y)?
Thanks!
cPickleinstead, as that is a faster way to save and load data in Python.uu.encodedoesn't encode anything into binary; it actually encodes binary into ASCII. So loading uuencoded text in Python will actually be slower since you have to unwrap the uuencoding, then load the ASCII floats from the decoded text.