Learnt it recently. A neat hidden feature in numpy.
I use loadtxt and savetxt to transfer ASCII coordinates and other information to and fro with an in house finite element software.
The quick plotting and ready availability of high level scientific libraries makes it easy to get a quick prototype up and running in python. And ASCII format files are the easiest way these models are read back into the fem software.
But the data sometimes becomes big and writing as text file do consume good mb of space.
Yesterday, accidentally found that if in savetxt, we use .gz as the file extension then python natively compresses the data using gzip compression.
That’s great. Reduces the size of the files by a factor of 80 %. And what’s more useful is, loadtxt can natively read a .gz file !! So getting zipped data back into python is just a single command.