| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
| |
Bare except is very rarely the right thing
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
This file had two functions called flatten_dtype, which did similar but
different things.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|\
| |
| | |
DOC: See also np.load and np.memmap in np.lib.format.open_memmap
|
| |
| |
| |
| |
| |
| |
| | |
np.load supports memmap_mode to open existing .npy files as
memory-mapped files. np.memmap supports creating or loading raw
binary files as memory-mapped files. This adds a link to a
function for creating memory-mapped files in .npy format.
|
| |
| |
| |
| | |
Closes #8166.
|
| |
| |
| |
| | |
The strings in error messages were left untouched
|
|/ |
|
| |
|
| |
|
| |
|
|
|
|
| |
with empty dtypes. See #6430
|
| |
|
|\
| |
| | |
savez: temporary file alongside with target file and improve exception message upon IOError
|
| | |
|
| | |
|
| |
| |
| |
| | |
Closes: gh-5336
|
|/ |
|
| |
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
In two places they were doing
>>> from StringIO import StringIO
Since Python 2.6 that should be
>>> from io import StringIO
Closes #5995.
|
|
|
|
|
| |
Deprecated in NumPy 1.5. If this causes problems in the 1.10 release
cycle the change can be reverted.
|
|
|
|
|
| |
Some keywords are deprecated and slated for removal in numpy 2.0.
Add comment to deprecation date to clarify that.
|
|
|
|
|
|
| |
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.
|
|\
| |
| | |
ENH: Multiple comment tokens in loadtxt
|
| | |
|
|/ |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Fixed typos in docstrings were updated for functions where the parameter
names in the docstring didn't match the function signature.
|
|
|
|
|
|
|
|
| |
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.
|
|\
| |
| | |
BUG: Fix genfromtext NameValidator arguments passed to easy_dtype.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
|\ \
| | |
| | | |
ENH:Add keyword max_rows to genfromtxt.
|
| | | |
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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 _compiled_base module into multiarray
|
| |
| |
| |
| | |
Allows access to internal functions for the file.
|
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
|/
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
[ci skip]
|