summaryrefslogtreecommitdiff
path: root/numpy/lib/npyio.py
Commit message (Collapse)AuthorAgeFilesLines
* DOC: Cleanup genfromtxt documentation a bit.Charles Harris2015-10-041-8/+7
|
* DOC: Update docs for numpy.genfromtxt.jason king2015-10-041-3/+5
| | | | | | | Note that a list of strings can be passed as the first parameter. The strings are treated as the lines in a file. Closes #6247
* BUG: fix #4381: precision loss on string -> longdouble conversionAnne Archibald2015-08-281-0/+2
| | | | | | | | | | | | | | | Avoid going through python floats when converting string to longdouble. This makes it dramatically easier to produce full-precision long double numbers. Fixed are the constructor (np.longdouble("1.01")), np.fromfile, np.fromstring, np.loadtxt, and np.genfromtxt (and functions based on it). Also fixed is precision loss when using np.tofile. This also fixes #1481, poor handling of bad data in fromfile and fromstring. If the function strtod_l is not available, almost none of this will work, and many tests will fail.
* DOC: Fix docstring warnings in documetation generation.Charles Harris2015-07-011-0/+1
| | | | | | | | | | | | Most of these fixes involve putting blank lines around .. versionadded:: x.x.x and .. deprecated:: x.x.x Some of the examples were also fixed.
* MAINT: remove legacy monkeypatching of GzipFileNathaniel J. Smith2015-06-241-49/+2
| | | | | | | | | | I'm not sure exactly when GzipFile.seek started supporting the whence= argument by default -- sometime around python 2.5 from the looks of http://bugs.python.org/issue1355023. But in any case it was definitely there by 2.6, which is now the earliest version we support, so there's no longer any need to monkeypatch it in. This also fixes an error in python 3.5b2, which I haven't bothered to track down further because these are the wages of monkeypatching.
* DOC: Fix examples in npyio.py to properly import StringIO.Charles Harris2015-06-211-2/+2
| | | | | | | | | | | | In two places they were doing >>> from StringIO import StringIO Since Python 2.6 that should be >>> from io import StringIO Closes #5995.
* DEP,MAINT: Remove keywords "skiprows" and "missing" from genfromtxt.Charles Harris2015-06-211-32/+9
| | | | | Deprecated in NumPy 1.5. If this causes problems in the 1.10 release cycle the change can be reverted.
* DEP: Add notes to some deprecations.Charles Harris2015-06-211-2/+2
| | | | | Some keywords are deprecated and slated for removal in numpy 2.0. Add comment to deprecation date to clarify that.
* MAINT: Mark deprecation warning with a date and Numpy version.Charles Harris2015-06-211-0/+2
| | | | | | This is to make it easier to find and remove deprecated features. It would be a good idea if all deprecations were made with similar comments.
* Merge pull request #4612 from Nodd/loadtxt_commentsCharles Harris2015-04-231-7/+15
|\ | | | | ENH: Multiple comment tokens in loadtxt
| * ENH: Multiple comment tokens in loadtxtJoseph Martinot-Lagarde2015-04-221-7/+15
| |
* | ENH: add options for disabling use of pickle in load/savePauli Virtanen2015-04-181-8/+36
|/
* BUG: loadtxt fails with complex data in Python 3.Charles Harris2015-03-111-2/+7
| | | | | | | | | | | The problem is that the Python complex type constructor only accepts a pair of numbers or a string, unlike other numeric types it does not work with byte strings. The numpy error is subtle, as loadtxt opens the file in the default text mode, but then converts the input lines to byte strings when they are split into separate values. The fix here is to convert the values back to strings in the complex converter. Closes #5655.
* STY: fold long linesPauli Virtanen2015-03-081-6/+8
|
* BUG: enable working around pickle compatibility issues on Py3 in npy filesPauli Virtanen2015-03-081-10/+58
| | | | | | Add pickle compatibility flags to numpy.save and numpy.load. Allow only combinations that cannot corrupt binary data in Numpy arrays. Use the same default values as Python pickle.
* DOC: Reconcile docstrings and function signatures where they disagreeRobert McGibbon2015-03-021-2/+2
| | | | | Fixed typos in docstrings were updated for functions where the parameter names in the docstring didn't match the function signature.
* ENH: Add support for float hex format to loadtxt.Chris Laumann2015-02-131-1/+12
| | | | | | | | Add _floatconv to npyio.py as a default floating point converter. This uses float() as a type conversion with a fallback on (ValueError) to float.fromhex(). Closes #2517.
* Merge pull request #5495 from charris/cleanup-gh-4649Charles Harris2015-01-241-1/+5
|\ | | | | BUG: Fix genfromtext NameValidator arguments passed to easy_dtype.
| * BUG: Fix genfromtext NameValidator arguments passed to easy_dtype.Alan Briolat2015-01-231-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | np.genfromtxt validates field names twice: once in genfromtxt and once in easy_dtype. Whilst the arguments to genfromtxt are used in the first validation, they aren't passed to easy_dtype (which is used only when dtype != None) and therefore in this case the default validation (strip non-alphanum, replace spaces) gets confusingly applied, ignoring genfromtxt's arguments. This patch adds fixes genfromtxt by passing the appropriate arguments onwards to easy_dtype. That is probably the least invasive way to fix the issue.
* | Merge pull request #5496 from charris/cleanup-gh-5103Charles Harris2015-01-241-3/+21
|\ \ | | | | | | ENH:Add keyword max_rows to genfromtxt.
| * | ENH: genfromtxt: Change 'nrows' to 'max_rows'.Warren Weckesser2015-01-231-18/+17
| | |
| * | ENH:Add keyword nrows to genfromtxt.styr2015-01-231-1/+20
| |/ | | | | | | | | | | | | | | | | | | This allows one to specify the maximum number of row processed in in a call. The new functionality allows for reading more complex data formats. For instance, multiple calls can be used to read in multiple arrays stored in a single file. Closes #5084. Closes #5093.
* | Merge pull request #5476 from juliantaylor/merge-cbaseJaime2015-01-231-1/+1
|\ \ | |/ |/| merge _compiled_base module into multiarray
| * MAINT: merge _compiled_base module into multiarrayJulian Taylor2015-01-221-1/+1
| | | | | | | | Allows access to internal functions for the file.
* | BUG: Fix loadtxt with comments=None and a string None data.Leonardo Donelli2015-01-231-2/+6
| | | | | | | | | | | | | | | | Current loadtxt with `comments=None` considers the string `'None'` as a comment symbol. Fixed by making split_line method check if comments is None. Closes #5155.
* | DOC: improve record/structured array nomenclature & guideAllan Haldane2015-01-221-2/+2
|/ | | | | | | | | | | This update adds a section better describing record arrays in the user guide (numpy/doc/structured_arrays.py). It also corrects nomenclature, such that "structured array" refers to ndarrays with structured dtype, "record array" refers to modified ndarrays as created by np.rec.array, and "recarray" refers to ndarrays viewed as np.recarray. See the note at the end of the structured array user guide.
* DOC: link to the npy-format NEP in numpy.npyio docs. Closes gh-4523.Ralf Gommers2015-01-021-2/+5
| | | | [ci skip]
* remove trailing whitespaceValentin Haenel2014-12-271-2/+2
|
* DOC: Give a more explicit reference to the .npy format documentation in the ↵Warren Weckesser2014-12-121-1/+2
| | | | 'save' docstring.
* ENH: More explicit error message for np.savetxtAdam Williams2014-11-301-1/+6
|
* ENH: add BagObj.__dir__ to numpy.lib.npyioWendell Smith2014-11-181-0/+8
| | | | | This allows dir(bagobj), and also enables tab-completion on a BagObj, which can be useful in an interpreter or IPython
* Merge pull request #5006 from dhomeier/ioconv_usecolsJulian Taylor2014-08-271-6/+9
|\ | | | | | | BUG: fix genfromtxt check of converters when using usecols
| * BUG: fix genfromtxt check of converters when using usecolsDerek Homeier2014-08-271-6/+9
| | | | | | | | | | | | fixes an issue reported by Adrian Altenhoff where user-supplied converters in genfromtxt were not tested with the right first_values when also specifying usecols.
* | BUG: io: genfromtxt did not handle filling_values=0 correctly. Closes gh-2317.Warren Weckesser2014-08-151-1/+3
| |
* | Merge pull request #4929 from juliantaylor/charris-pep8-numpy-libCharles Harris2014-07-311-18/+17
|\ \ | |/ | | Charris pep8 numpy lib
| * STY: Make files in numpy/lib PEP8 compliant.Charles Harris2014-07-311-16/+13
| | | | | | | | The rules enforced are the same as those used for scipy.
| * MAINT: Fixes for problems in numpy/lib revealed by pyflakes.Charles Harris2014-07-311-2/+4
| | | | | | | | | | | | Some of those problems look like potential coding errors. In those cases a Fixme comment was made and the offending code, usually an unused variable, was commented out.
* | DOC: remove wrong mention of .gz in np.loadJulian Taylor2014-06-111-2/+1
|/ | | | closes gh-312
* DOC: clarify savetxt delimiter and newline docstringJulian Taylor2014-05-261-2/+2
| | | newline and delimiter can be strings not only single characters
* Merge pull request #4574 from ggventurini/masterJulian Taylor2014-05-261-1/+2
|\ | | | | DOC: Docstring fix for `savetxt` (minor change)
| * Docstring fix for `savetxt`ggventurini2014-04-011-1/+2
| |
* | ENH: Better error w/ line num for bad column count in np.loadtxt()Daniel da Silva2014-04-051-0/+5
|/ | | | Resolves #2591. Adds more explicit error handling in line parsing loop.
* Merge pull request #3830 from jarondl/recfromcsvCharles Harris2014-03-281-10/+13
|\ | | | | MAINT (API?): organize npyio.recfromcsv defaults
| * STY: change and delete some comments in recfromcsvjarondl2014-03-121-5/+1
| | | | | | | | | | Removed two irrelevant comments about code history. P.S. my first try with Github's online editor.
| * DOC: npyio.recfromcsv keyword argument changesYaron de Leeuw2014-02-281-0/+5
| | | | | | | | | | | | Added a note to recfromcsv about the `dtype` keyword, as suggested by @hpaulj. Also added a note to the release notes, about the change in the `update` keyword, as suggested by @charris.
| * MAINT (API?): organize npyio.recfromcsv defaultsYaron de Leeuw2014-02-281-10/+12
| | | | | | | | | | | | | | | | | | | | | | | | Organizes the default kwargs in recfromcsv. Changes two undocumented kwargs behaviors: * previously, if a user set `names=None`, it was ignored and replaced with `names=True` * the `dtype` kwarg was ignored. If `update` was given, it was used as `dtype`, and if not, None was used. We can retain the `update` behavior by using `kwargs.setdefault("dtype",kwargs.get('update', None))`. This Closes #311 .
* | DOC: two minor typos in genfromtxtjarondl2014-03-041-2/+2
| |
* | DOC: add missing parameters to npyio.genfromtxt, fix #2929Yaron de Leeuw2014-03-031-1/+9
| | | | | | | | | | | | `loose` `missing` and `skiprows` were missing from the docstring of `npyio.genfromtxt`. The later two are actualy deprecated, but were added nonetheless.
* | Merge pull request #4376 from charris/fix-gh-2807Charles Harris2014-03-011-14/+18
|\ \ | |/ |/| DOC: Improve the documentation of numpy.load.
| * DOC: Improve the documentation of numpy.load.Charles Harris2014-02-261-14/+18
| | | | | | | | | | | | | | Add the fact that for pickled files, a file-like object must also support the readline() method. Closes #2807.