summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatti Picus <matti.picus@gmail.com>2021-05-25 08:41:58 +0300
committerGitHub <noreply@github.com>2021-05-25 08:41:58 +0300
commita988464b5050e4d3aa0db90ea649f254db8ed7fb (patch)
treea80c3a70a2a8a895c0916a471d193fe00016847f
parentfe3d717080e812383900507168a6bd7093c4e434 (diff)
parent09dcb3bbe932c49e50a4eee392972e5ddd54985a (diff)
downloadnumpy-a988464b5050e4d3aa0db90ea649f254db8ed7fb.tar.gz
Merge pull request #19087 from melissawm/savez-kwarg
DOC: Add note to savez about naming variables with keyword `file`.
-rw-r--r--numpy/lib/npyio.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/numpy/lib/npyio.py b/numpy/lib/npyio.py
index 9552579cf..5780a05bb 100644
--- a/numpy/lib/npyio.py
+++ b/numpy/lib/npyio.py
@@ -586,6 +586,10 @@ def savez(file, *args, **kwds):
inside the ZIP archive. Therefore, keys should be valid filenames.
E.g., avoid keys that begin with ``/`` or contain ``.``.
+ When naming variables with keyword arguments, it is not possible to name a
+ variable ``file``, as this would cause the ``file`` argument to be defined
+ twice in the call to ``savez``.
+
Examples
--------
>>> from tempfile import TemporaryFile