Skip to content

Commit 8235ebd

Browse files
committed
DOC: clarify doc re: unsupported keys in savez.
The previous wording ("When saving dictionaries") could be interpreted as refering to calls like `savez("foo.npz", {"a": 1, "b": 2})` (literally "saving a dict to foo.npz"); reword to avoid this possibility of confusion.
1 parent c3d1107 commit 8235ebd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

numpy/lib/npyio.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -581,9 +581,9 @@ def savez(file, *args, **kwds):
581581
its list of arrays (with the ``.files`` attribute), and for the arrays
582582
themselves.
583583
584-
When saving dictionaries, the dictionary keys become filenames
585-
inside the ZIP archive. Therefore, keys should be valid filenames.
586-
E.g., avoid keys that begin with ``/`` or contain ``.``.
584+
Keys passed in `kwds` are used as filenames inside the ZIP archive.
585+
Therefore, keys should be valid filenames; e.g., avoid keys that begin with
586+
``/`` or contain ``.``.
587587
588588
When naming variables with keyword arguments, it is not possible to name a
589589
variable ``file``, as this would cause the ``file`` argument to be defined

0 commit comments

Comments
 (0)