| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Built-in function `len()` should not have prefix `builtins.`,
so removed it to fix the reference.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
This makes it possible for new-style NEP 42 string dtypes like ASCIIDType to work with the functions in np.char, this has leads to some mild modification (stricter behavior in bad paths).
It will only work with dtypes with a scalar that subclasses str or bytes. I also assume that you can create instances of the user dtype from python like dtype_instance = CustomDType(size_in_bytes). This is a pretty big assumption about the API of the dtype, I'm not sure offhand how I can do this more portably or more safely.
I also added a new macro, NPY_DT_is_user_defined, which checks dtype->type_num == -1, which is currently true for all custom dtypes using the experimental dtype API. This new macro is needed because NPY_DT_is_legacy will return false for np.void.
This is only tested via the user dtypes currently.
|
| |
|
|
|
|
|
| |
Co-authored-by: Tyler Reddy <tyler.je.reddy@gmail.com>
Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
|
|
|
|
|
|
|
| |
* DOC: examples for np.char.isdecimal and np.char.isnumeric (See #22267)
* DOC: fix formatting np.char function example (See #22267)
* DOC: remove non-array input examples (See #22267)
|
|
|
| |
Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* added examples for isupper
* fixed examples for isupper
* Update numpy/core/defchararray.py
Co-authored-by: Rohit Goswami <r95g10@gmail.com>
* Update numpy/core/defchararray.py
Co-authored-by: Rohit Goswami <r95g10@gmail.com>
* Update numpy/core/defchararray.py
Co-authored-by: Rohit Goswami <r95g10@gmail.com>
* Update numpy/core/defchararray.py
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
Co-authored-by: Rohit Goswami <r95g10@gmail.com>
Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
Co-authored-by: Charles Harris <charlesr.harris@gmail.com>
|
|
|
| |
The docstring was previously a copy-paste error from `encode` rather than `decode`.
|
|
|
|
|
|
|
|
|
| |
Add examples for join and index for issue #22267
* DOC: add join, index examples
* DOC: update join in np.char
Co-authored-by: Brigitta Sipőcz <b.sipocz@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
resolves #22267 partially by adding examples to np.char.multiply
* DOC: add examples to np.char.mutiply
* Update numpy/core/defchararray.py
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* Update numpy/core/defchararray.py
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
|
|\
| |
| | |
DOC: Added an example for isupper() function
|
| | |
|
| |
| |
| | |
Co-authored-by: Brigitta Sipőcz <b.sipocz@gmail.com>
|
| | |
|
|/ |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Numpydoc seem to suggest Also should be uppercase,
and as far as I can tell this is the main spelling found in this code
base:
$ rg '^ +See also$' | wc -l
109
$ rg '^ +See Also$' | wc -l
814
This commit update one offending file that contain ~90 lowercase `See also`.
|
| |
|
| |
|
|
|
|
|
| |
types (#15816)
Cleanup from the dropping of python 2
|
|\
| |
| | |
DEP: Do not allow "abstract" dtype conversion/creation
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
These dtypes do not really make sense as instances. We can (somewhat)
reasonably define np.dtype(np.int64) as the default (machine endianess)
int64. (Arguably, it is unclear that `np.array(arr_of_>f8, dtype="f")`
should return arr_of_<f8, but that would be very noisy!)
However, `np.integer` as equivalent to long, is not well defined.
Similarly, `dtype=Decimal` may be neat to spell `dtype=object` when you
intend to put Decimal objects into the array. But it is misleading,
since there is no special meaning to it at this time.
The biggest issue with it, is that `arr.astype(np.floating)` looks
like it will let float32 or float128 pass, but it will force a
float64 output! Arguably downcasting is a bug in this case.
A related issue is `np.dtype("S")` and especially "S0". The dtype "S"
does make sense for most or all places where `dtype=...` can be
passed. However, it is conceptionally different from other dtypes, since
it will not end up being attached to the array (unlike "S2" which
would be). The dtype "S" really means the type number/DType class
of String, and not a specific dtype instance.
|
|/
|
|
|
|
|
|
| |
These APIs work with either UCS2 or UCS4, depending on the value of `Py_UNICODE_WIDE`.
After python 3.3, there's a better way to handle this type of thing, which means we no longer have to care about this.
Fixes gh-3258
Fixes gh-15363
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
As numpy is Python 3 only, these import statements are now unnecessary
and don't alter runtime behavior.
|
| |
|
| |
|
|
|
|
|
| |
Fixed order=FORTRAN in docs
Added release snippet
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* restored regression comment in
numpy/core/defchararray.py
* fixed the dimensionality of the z
array in all() docstring in
numpy/core/fromnumeric.py; this isn't
detected because it is in-line with
variable memory addresses which are
tagged as variable for refguide
* byte_bounds() docstring adjusted
to reflect non-variable dtype
after reviewer requested removal
of complex dtype
* restore an original comment
in matmul docstring, as requested
by reviewer
|
| |
|
|
|
|
|
|
|
|
| |
* ported the refguide_check module from SciPy for usage
in NumPy docstring execution/ verification; added the
refguide_check run to Azure Mac OS CI
* adjusted NumPy docstrings such that refguide_check passes
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes GH-12271
Tests verify that everything in ``dir(numpy)`` either has ``__module__`` set to
``'numpy'``, or appears in an explicit whitelist of undocumented functions and
exported bulitins. These should eventually be documented or removed.
I also identified a handful of functions for which I had accidentally not setup
dispatch for with ``__array_function__`` before, because they were listed under
"ndarray methods" in ``_add_newdocs.py``. I guess that should be a lesson in
trusting code comments :).
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
The strings in error messages were left untouched
|
|
|
|
|
|
|
|
|
| |
These fixes are not agressive as some of the code is complicated
and it is better to be careful.
The files numeric.py and numerictypes.py are not easily analysed
and the latter is self modifying. Pyflakes generates a number of
invalid warnings for those files.
|