diff options
author | Kevin Sheppard <kevin.k.sheppard@gmail.com> | 2018-05-22 14:06:37 +0100 |
---|---|---|
committer | Kevin Sheppard <kevin.k.sheppard@gmail.com> | 2018-05-22 17:24:00 +0100 |
commit | d3820fe823087fff37433fb0b2cb76c0b984fe44 (patch) | |
tree | de9ff7c7f2b3dc2a16e727227a0d2f4a1edd515f /numpy/add_newdocs.py | |
parent | b08ce1ad3705b1cfbdb89b3be50c1756c74982c3 (diff) | |
download | numpy-d3820fe823087fff37433fb0b2cb76c0b984fe44.tar.gz |
DOC: Clarify tofile requirement
Clarify that tofile requires a file that can be directly written to
and not a general file-like object
Diffstat (limited to 'numpy/add_newdocs.py')
-rw-r--r-- | numpy/add_newdocs.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/numpy/add_newdocs.py b/numpy/add_newdocs.py index e8030d562..fc2130096 100644 --- a/numpy/add_newdocs.py +++ b/numpy/add_newdocs.py @@ -4759,6 +4759,11 @@ add_newdoc('numpy.core.multiarray', 'ndarray', ('tofile', machines with different endianness. Some of these problems can be overcome by outputting the data as text files, at the expense of speed and file size. + + When fid is a file object, array contents are directly written to the + file, bypassing the file object's ``write`` method. As a result, tofile + cannot be used with files objects supporting compression (e.g., GzipFile) + or file-like objects that do not support ``fileno()`` (e.g., BytesIO). """)) |