[Numpy-discussion] how do I specify maximum line length when using savetxt?

Paul Anton Letnes paul.anton.letnes@gmail....
Wed Dec 5 15:56:55 CST 2012


On 5. des. 2012, at 22:35, Mark Bakker wrote:

> Hello List,
> 
> I want to write a large array to file, and each line can only be 80
> characters long.
> Can I use savetxt to do that? Where would I specify the maximum line length?

If you specify the format, %10.3f for instance, you will know the max line length if you also know the array shape.


> Or is there a better way to do this?

Probably 1000 ways to accomplish the same thing out there, sure.

Cheers
Paul


> 
> Thanks,
> 
> Mark
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion



More information about the NumPy-Discussion mailing list