summaryrefslogtreecommitdiff
path: root/numpy/lib/npyio.py
Commit message (Collapse)AuthorAgeFilesLines
...
* | ENH: __array_function__ support for np.lib, part 2/2 (#12119)Stephan Hoyer2018-10-221-0/+29
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ENH: __array_function__ support for np.lib, part 2 xref GH12028 np.lib.npyio through np.lib.ufunclike * Fix failures in numpy/core/tests/test_overrides.py * CLN: handle depreaction in dispatchers for np.lib.ufunclike * CLN: fewer dispatchers in lib.twodim_base * CLN: fewer dispatchers in lib.shape_base * CLN: more dispatcher consolidation * BUG: fix test failure * Use all method instead of function in assert_equal * DOC: indicate n is array_like in scimath.logn * MAINT: updates per review * MAINT: more conservative changes in assert_array_equal * MAINT: add back in comment * MAINT: casting tweaks in assert_array_equal * MAINT: fixes and tests for assert_array_equal on subclasses
* MAINT, TST import pickle from numpy.core.numericPierre Glaser2018-10-101-2/+1
| | | | | | | | All imports of pickle from numpy modules are now done this way: >>> from numpy.core.numeric import pickle Also, some loops on protocol numbers are added over pickle tests that were not caught from #12090
* MAINT: remove unused stdlib importsEmil Hessman2018-09-301-1/+0
|
* Merge pull request #11962 from mfkasim91/limitrowloadtxtCharles Harris2018-09-301-2/+9
|\ | | | | ENH: maximum lines of content to be read from numpy.loadtxt
| * MAINT: Omit None in max_rows for np.loadtxt docstringmfkasim912018-09-301-1/+1
| |
| * MAINT: No tick for None in `max_rows` docstring for `np.loadtxt`mfkasim912018-09-301-1/+1
| |
| * ENH: add max_rows kwarg to numpy.loadtxt like numpy.genfromtxtmfkasim912018-09-301-2/+9
| |
* | BUG: Don't leave files open and dangling if np.load has a bad encoding ↵Eric Wieser2018-09-231-13/+14
| | | | | | | | argument, or the file is an invalid zip
* | MAINT: refactor design of recursive closures (#11910)Matti Picus2018-09-161-9/+7
|/
* BUG: fix np.load() of empty .npz fileJohn Zwinck2018-07-071-1/+2
| | | | Fixes #9989
* HTTP -> HTTPS, and other linkrot fixesMike Toews2018-06-161-3/+3
|
* Merge branch 'master' into npzfile-mappinEric Wieser2018-05-291-17/+13
|\
| * DOC: add numpy.lib.format to docs and link to itmattip2018-05-141-3/+3
| |
| * DOC: create label and ref, fixes broken linkmattip2018-05-131-3/+3
| |
| * DOC: link to updated module docstring, not NEPmattip2018-05-131-9/+5
| |
| * DOC: Add explanation for comments=None in loadtxt.Hong Xu2018-05-061-2/+2
| |
| * DOC: Make doc examples using StringIO python2-3 compatibleAndras Deak2018-04-271-5/+5
| |
| * MAINT, DOC: Fix typos (#10958)Nicholas Nadeau, P.Eng., AVS2018-04-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | * fixed doc typo * fixed lib typos * fixed lapack_lite typos * Revert "fixed lapack_lite typos" This reverts commit e7dada860cb73af190234402508ab79965ecd079.
* | Merge branch 'master' into npzfile-mappinEric Wieser2018-04-221-15/+23
|\ \ | |/
| * DOC: clear up warnings, fix matplotlib plotmattip2018-04-171-7/+8
| |
| * BUG: fix crash in numpy.genfromtxt(..., names=True, comments=None) (#10822)Raunak Shah2018-04-161-3/+4
| | | | | | | | Fixes gh-10780
| * BUG: fix savetxt, loadtxt for '+-' in complexmattip2018-04-101-2/+3
| |
| * Fix low-hanging Pypy compatibility issues (#10737)Pauli Virtanen2018-03-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | * TST: skip refcount-requiring tests if sys.refcount is missing * ENH: io: add refcheck=False to a safe .resize() call The array is allocated immediately above, and the resize always succeeds so it is not necessary to check it. Fixes Pypy compatibility. * TST: remove unused code * TST: factor skipif(not HAS_REFCOUNT) into a separate decorator
| * Merge pull request #10501 from msornay/fromregex-bytesEric Wieser2018-02-201-2/+2
| |\ | | | | | | BUG: fromregex: asbytes called on regexp objects
| | * BUG: fromregex: asbytes called on regexp objectsMathieu Sornay2018-02-051-2/+2
| | | | | | | | | | | | | | | | | | When calling fromregex() with a binary stream and a regular expression object, asbytes() was called on the regexp object, resulting in an incorrect regular expression being compiled and used.
| * | BUG: break cyclic refs in recursive closuresAllan Haldane2018-02-181-0/+5
| | | | | | | | | | | | Fixes #10620
* | | ENH: Make NpzFile conform to the Mapping protocolEric Wieser2018-02-201-27/+32
|/ / | | | | | | | | | | | | | | | | This is potentially a breaking change for python 3, because the Mapping protocol changed between python 2 and python 3 - `items()` and `keys()` now return views, not lists. In practice, any user running `2to3` should have found this fixed itself automatically. Also fixes dir(np.lib.npyio.BagObj(dict(a=1))) on python 3. Fixes gh-1723
* | Merge pull request #10401 from eric-wieser/fix-10394Charles Harris2018-02-061-17/+20
|\ \ | | | | | | BUG: Resize bytes_ columns in genfromtxt
| * | BUG: Resize bytes_ columns in genfromtxtEric Wieser2018-01-151-17/+20
| | | | | | | | | | | | Fixes gh-10394, due to regression in gh-10054
* | | DOC: See #10098 and minor punctuation cleanup (#10478)Derrick Williams2018-01-281-8/+9
| |/ |/| | | | | | | | | * DOC: See #10098 and minor punctuation cleanup * DOC: Correcting per PR comments
* | DOC: Prepare to host NEPs on GH pagesJarrod Millman2017-12-141-3/+3
| |
* | DOC: fix minor typosUnknown2017-12-121-2/+2
| |
* | DEP: Deprecate the pickle aliasesEric Wieser2017-12-101-1/+8
|/ | | | | | * The np.ma functions are misleading, as they do not actually do anything special for ma.array * The np.loads functions doesn't even have numpy-specific documentation, and does not behave consistently with `np.load` * The string overloads of np.ma.load and np.ma.dump do not work well on python 3, as they make assumptions about whether a binary or text pickle file is used (gh-5491)
* MAINT: Refactor some code in npyio.py.Charles Harris2017-11-211-39/+39
|
* DOC: Add some docstrings and edit others.Charles Harris2017-11-211-15/+27
| | | | | | | Add docstrings for some of the support functions in _datasource and npyio in order to aid future maintainers. [ci skip]
* ENH: Add encoding option to numpy text IO.Julian Taylor2017-11-211-100/+246
| | | | | | | | | | | This modifies loadtxt and genfromtxt in several ways intended to add unicode support for text files by adding an `encoding` keyword to np.load, np.genfromtxt, np.savetxt, and np.fromregex. The original treatment of the relevant files was to open them as byte files, whereas they are now opened as text files with an encoding. When read, they are decoded to unicode strings for Python3 compatibility, and when written, they are encoded as specified. For backward compatibility, the default encoding in both cases is latin1.
* DOC: Clarify behavior of genfromtxt names fieldDavid Freese2017-10-241-5/+6
| | | | | | | | | The documentation on the name parameter for npyio.genfromtxt uses the phrase "valid line" which doesn't completely describe it's behavior. This updates the documentation on the names field to indicate the first line, with or without a comment delimeter, will be taken for the names field. fixes #9878
* DOC: Unindent enumeration in savetxt docstringAndras Deak2017-10-211-4/+4
| | | | | | The rendered markdown in the online documentation was broken due to the one-character indentation added in the multiline enumerations of the docstring of savetxt.
* ENH: Save to ZIP files without using temporary files.Serhiy Storchaka2017-10-151-22/+33
| | | | | Since Python 3.6 it is possible to write directly to a ZIP file, without creating temporary files.
* ENH Better error message for savetxt when X.ndim > 2Nelle Varoquaux2017-09-201-2/+5
| | | | | savetxt does not support saving arrays of dimension 0 or higher than 2. This pull request improves the message of the error raised.
* Updates order of parameters in save docstring to match function parameter orderJames Bourbeau2017-08-301-2/+2
|
* MAINT/DOC: Use builtin when np.{x} is builtins.{x}.Eric Wieser2017-08-051-7/+7
| | | | | | | This is the case for x in {int, bool, str, float, complex, object}. Using the np.{x} version is deceptive as it suggests that there is a difference. This change doesn't affect any external behaviour. The `long` type is missing in python 3, so np.long is still useful
* MAINT: Fix alerts from http://lgtm.com (#9292)Jean Helie2017-06-261-1/+1
| | | | | | | * make exception raising 2/3 compatible * remove unnecesary else statement after while loop without break clause * ensure file is always enclosed even in the event of an exception * ensure list comprehension variable does not override enclosing loop variable
* BUG: KeyboardInterrupt is swallowed all over the placeEric Wieser2017-06-031-1/+1
| | | | Bare except is very rarely the right thing
* MAINT: Remove asbytes where a b prefix would sufficeEric Wieser2017-03-251-9/+9
| | | | | | | | Since we only need to support python 2, we can remove any case where we just pass a single string literal and use the b prefix instead. What we can't do is transform asbytes("tests %d" % num), because %-formatting fails on bytes in python 3.x < 3.5.
* MAINT: Rename function to prevent name-shadowingEric Wieser2017-03-231-3/+4
| | | | | This file had two functions called flatten_dtype, which did similar but different things.
* MAINT: replace len(x.shape) with x.ndimEric Wieser2017-02-241-1/+1
|
* DOC: Add example to np.savez_compressedMartin Thoma2017-01-151-6/+44
|
* BUG: Apply more robust string converts in loadtxtgfyoung2016-12-081-2/+2
| | | | | | | | | | The original dtype converters for bytes and str did not account for converting objects of str or bytes dtype respectively. Replace the original converters with those from numpy.compat, which are much more robust. Closes gh-8033.
* Merge pull request #7987 from f0k/advertise-open_memmapCharles Harris2016-10-281-0/+1
|\ | | | | DOC: See also np.load and np.memmap in np.lib.format.open_memmap