| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
[ci skip]
|
| |
|
|
|
|
|
|
|
|
|
| |
Instances remain for NumpyVersion and Numpy.rec.fromarrays that are
references to code.
Release notes were left unchanged.
see issue #7986
|
|
|
|
| |
[ci skip]
|
| |
|
| |
|
|
|
|
| |
Fixes #6521
|
|
|
|
|
|
|
| |
Examples
:cdata: -> :c:data:
.. cfunction:: -> .. c:function::
|
| |
|
|\
| |
| | |
DOC: add documentation for some scalar checks
|
| |
| |
| |
| | |
DOC: Mention that PyArray_Return steals a reference to arr
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
|/
|
|
| |
PyArray_ITEMSIZE
|
| |
|
| |
|
|
|
|
| |
closes gh-4579
|
|
|
|
|
| |
also fix wrong capi documentation of PyArray_NewFromDescr stating it
accepts NULL dtype while it does not.
|
|
|
|
| |
I find it much more convenient to define the PY_ARRAY_UNIQUE_SYMBOL in a
header file #included by all files of the extension (than to repeat its definition in each and every file).
|
|
|
|
|
|
| |
- promote_types does not return correct string size for integer and string arguments. Fix so that integer and string types are promoted to string type that is long enough to hold integer type safely cast to string.
- can_cast incorrectly returns True for certain integer and string types. Fix so that can_cast only returns True if string type is long enough to hold integer type safely cast to string.
- calling astype to convert integer to string should fail if string type is not long enough to hold integer converted to string and casting argument is set to "safe".
|
|
|
| |
Add a note explaining the ``out`` parameter of some functions.
|
|
|
|
|
|
| |
Found by trac user komnomnomnom.
Closes #588.
|
|
|
|
|
|
|
| |
tostring returns bytes which are not equal to string, so provide a
tobytes function alias.
tostring does not emit a deprecation warning yet so rdepends do not need
to check two names to support older versions of numpy without warnings.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A partition sorts the kth element into its sorted order and moves all
smaller elements before the kth element and all equal or greater
elements behind it.
The ordering of all elements in the partitions is undefined.
It is implemented via the introselection algorithm which has worst case
linear complexity compared to a full sort that has linearithmic
complexity.
The introselect algorithm uses a quickselect with median of three pivot
and falls back to a quickselect with median of median of five pivot if
no sufficient progress is made.
The pivots used during the search for the wanted kth element can
optionally be stored and reused for further partitionings of the array.
This is used by the python interface if an array of kth is provided to
the partitions function. This improves the performance of median and
which need to select two elements if the size of the array is even. A
percentile function interpolating between values also profits from this.
String selection is implemented in terms of quicksort which has the same
properties as a selection for now.
|
| |
|
|
|
|
|
|
| |
This includes documentation in the release notes, as well as the
reference guide and smaller corrections. Thanks to Nathaniel
for major rewriting this.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The original masked-NA-NEP branch contained a large number of changes
in addition to the core NA support. For example:
- ufunc.__call__ support for where= argument
- nditer support for arbitrary masks (in support of where=)
- ufunc.reduce support for simultaneous reduction over multiple axes
- a new "array assignment API"
- ndarray.diagonal() returning a view in all cases
- bug-fixes in __array_priority__ handling
- datetime test changes
etc. There's no consensus yet on what should be done with the
maskna-related part of this branch, but the rest is generally useful
and uncontroversial, so the goal of this branch is to identify exactly
which code changes are involved in maskna support.
The basic strategy used to create this patch was:
- Remove the new masking-related fields from ndarray, so no arrays
are masked
- Go through and remove all the code that this makes
dead/inaccessible/irrelevant, in a largely mechanical fashion. So
for example, if I saw 'if (PyArray_HASMASK(a)) { ... }' then that
whole block was obviously just dead code if no arrays have masks,
and I removed it. Likewise for function arguments like skipna that
are useless if there aren't any NAs to skip.
This changed the signature of a number of functions that were newly
exposed in the numpy public API. I've removed all such functions from
the public API, since releasing them with the NA-less signature in 1.7
would create pointless compatibility hassles later if and when we add
back the NA-related functionality. Most such functions are removed by
this commit; the exception is PyArray_ReduceWrapper, which requires
more extensive surgery, and will be handled in followup commits.
I also removed the new ndarray.setasflat method. Reason: a comment
noted that the only reason this was added was to allow easier testing
of one branch of PyArray_CopyAsFlat. That branch is now the main
branch, so that isn't an issue. Nonetheless this function is arguably
useful, so perhaps it should have remained, but I judged that since
numpy's API is already hairier than we would like, it's not a good
idea to add extra hair "just in case". (Also AFAICT the test for this
method in test_maskna was actually incorrect, as noted here:
https://github.com/njsmith/numpyNEP/blob/master/numpyNEP.py
so I'm not confident that it ever worked in master, though I haven't
had a chance to follow-up on this.)
I also removed numpy.count_reduce_items, since without skipna it
became trivial.
I believe that these are the only exceptions to the "remove dead code"
strategy.
|
| |
|
|
|
|
|
| |
Also remove swig support for numpy < 1 from numpy.i since it expects
the old macros.
|
|
|
|
|
|
|
|
| |
for legacy code
These functions now reject inputs with NA, and there are alternative
functions PyArray_AllowNAConverter and PyArray_OutputAllowNAConverter
that functions should use when they intend to support NA.
|
| |
|
| |
|
|
|
|
|
| |
It should also have less memory usage for heterogeneous inputs,
because it no longer makes extra copies in that case.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
These functions expose masked copying routines, with and without
handling of overlapping data. Also deprecated the np.putmask and
PyArray_PutMask functions, because np.copyto supercedes their
functionality. This will need to be discussed on the list during
the pull request review.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
np.zeros_like, and np.ones_like
This way, the sub-type can be avoided if necessary. This helps mitigate,
but doesn't fix, ticket #1753, by allowing "b = np.empty_like(a, subok=False)".
|
|
|
|
| |
documentation
|
|
|
|
|
|
|
|
|
| |
of the assignment output
This change got Travis's -10 veto for 1.6.
An unfortunate consequence of reverting this is that some of the broadcasting
error messages get worse, but they're still no worse than in 1.5.
|
| |
|
| |
|
| |
|