diff options
author | Ralf Gommers <ralf.gommers@googlemail.com> | 2012-03-03 21:20:13 +0100 |
---|---|---|
committer | Ralf Gommers <ralf.gommers@googlemail.com> | 2012-03-03 22:34:02 +0100 |
commit | f4dd54aa614b263950b7a57329eb0ab9a2f2eadf (patch) | |
tree | ef7178a9b7801f42c31290624faf76a1cf5b969c /numpy/core/memmap.py | |
parent | 91f87e1f613630ff0ad9864017f059afcd6e57f1 (diff) | |
download | numpy-f4dd54aa614b263950b7a57329eb0ab9a2f2eadf.tar.gz |
DOC: merge wiki doc edits.
Diffstat (limited to 'numpy/core/memmap.py')
-rw-r--r-- | numpy/core/memmap.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/numpy/core/memmap.py b/numpy/core/memmap.py index 1ab9f87fc..53f9a3f07 100644 --- a/numpy/core/memmap.py +++ b/numpy/core/memmap.py @@ -60,11 +60,16 @@ class memmap(ndarray): Default is 'r+'. offset : int, optional In the file, array data starts at this offset. Since `offset` is - measured in bytes, it should be a multiple of the byte-size of - `dtype`. Requires ``shape=None``. The default is 0. + measured in bytes, it should normally be a multiple of the byte-size + of `dtype`. When ``mode != 'r'``, even positive offsets beyond end of + file are valid; The file will be extended to accommodate the + additional data. The default offset is 0. shape : tuple, optional - The desired shape of the array. By default, the returned array will be - 1-D with the number of elements determined by file size and data-type. + The desired shape of the array. If ``mode == 'r'`` and the number + of remaining bytes after `offset` is not a multiple of the byte-size + of `dtype`, you must specify `shape`. By default, the returned array + will be 1-D with the number of elements determined by file size + and data-type. order : {'C', 'F'}, optional Specify the order of the ndarray memory layout: C (row-major) or Fortran (column-major). This only has an effect if the shape is @@ -79,7 +84,6 @@ class memmap(ndarray): mode : str File mode. - Methods ------- close @@ -89,6 +93,7 @@ class memmap(ndarray): When you delete a memmap object, flush is called first to write changes to disk before removing the object. + Notes ----- The memmap object can be used anywhere an ndarray is accepted. |