[Numpy-svn] r3114 - trunk/numpy

numpy-svn at scipy.org numpy-svn at scipy.org
Mon Sep 4 19:54:11 CDT 2006


Author: charris
Date: 2006-09-04 19:54:09 -0500 (Mon, 04 Sep 2006)
New Revision: 3114

Modified:
   trunk/numpy/add_newdocs.py
Log:
Document the method tofile()

Modified: trunk/numpy/add_newdocs.py
===================================================================
--- trunk/numpy/add_newdocs.py	2006-09-04 23:23:40 UTC (rev 3113)
+++ trunk/numpy/add_newdocs.py	2006-09-05 00:54:09 UTC (rev 3114)
@@ -1035,8 +1035,26 @@
 
 
 add_newdoc('numpy.core.multiarray', 'ndarray', ('tofile',
-    """a.tofile(fid, sep="") -> None. Write the data to a file.
+    """a.tofile(fid, sep="", format="%s") -> None. Write the data to a file.
 
+    Required arguments:
+        file -- an open file object or a filename
+
+    Keyword arguments:
+        sep -- separator for text output. Write binary if empty (default "")
+        format -- format string for text file output (default "%s")
+
+    A convenience function for quick storage of array data. Information on
+    endianess and precision is lost, so this method is not a good choice for
+    files intended to archive data or transport data between machines with
+    different endianess. Some of these problems can be overcome by outputting
+    text files at the expense of speed and file size.
+
+    If 'sep' is empty this method is equivalent to file.write(a.tostring()). If
+    'sep' is not empty each data item is converted to the nearest Python type
+    and formatted using "format"%item. The resulting strings are written to the
+    file separated by the contents of 'sep'.
+
     """))
 
 



More information about the Numpy-svn mailing list