summaryrefslogtreecommitdiff
path: root/numpy/core/defchararray.py
Commit message (Collapse)AuthorAgeFilesLines
* DOC: Fix a reference to built-in `len` in `char.str_len` docstringyuki2023-04-031-1/+1
| | | | | Built-in function `len()` should not have prefix `builtins.`, so removed it to fix the reference.
* MAINT, DOC: string_ → bytes_ and unicode_ → str_Dimitri Papadopoulos2023-02-101-32/+32
|
* DOC: unicode → strDimitri Papadopoulos2023-02-101-4/+4
|
* ENH: allow NEP 42 dtypes to work with np.char (#22863)Nathan Goldbaum2023-01-101-32/+45
| | | | | | | | | 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.
* MAINT: Move set_module to numpy.core to use without C importSebastian Berg2022-11-241-1/+2
|
* DOC: add examples to numpy.char.replace (#22308)Simran Makandar2022-09-301-0/+9
| | | | | 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` (#22300)lzha972022-09-261-1/+11
| | | | | | | * 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)
* DOC: Add examples for isdigit and str_len (#22291)Digya0532022-09-191-0/+21
| | | Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
* DOC: Add `isupper` examples (#22285)Sarah Coffland2022-09-191-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* DOC: Correct usage example for np.char.decode docstring (#22309)Brent Tan2022-09-191-9/+9
| | | The docstring was previously a copy-paste error from `encode` rather than `decode`.
* DOC: Add examples for join and index (#22299)Yunika Bajracharya2022-09-191-0/+15
| | | | | | | | | 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>
* DOC: add examples to np.char.multiply (#22294)Eric-Shang2022-09-191-1/+18
| | | | | | | | | | | | | | | 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>
* Merge pull request #22295 from tahsinsoha/isupperCharles Harris2022-09-181-0/+7
|\ | | | | DOC: Added an example for isupper() function
| * MAIN: `import numpy as np` is not neededCharles Harris2022-09-181-2/+1
| |
| * Update numpy/core/defchararray.pyCharles Harris2022-09-181-1/+1
| | | | | | Co-authored-by: Brigitta Sipőcz <b.sipocz@gmail.com>
| * Added an example for isupper() functionSabiha Tahsin Soha2022-09-161-0/+8
| |
* | DOC: Add example for findYunika Bajracharya2022-09-161-0/+6
|/
* Add usage example to np.char.center docstringSatish Mishra2022-07-021-0/+16
|
* MAINT: Override the modules of `np.char` and `np.rec` functionsBas van Beek2021-09-211-0/+2
|
* MAINT: removed unused imports listed in LGTMdefault-3032021-05-241-1/+0
|
* DOC: See also -> See Also (casing)Matthias Bussonnier2021-01-271-91/+91
| | | | | | | | | | | | | 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`.
* DOC: Clarify that `np.char.compare_chararrays` returns an `ndarray`Bas van Beek2020-08-091-12/+12
|
* DOC: Fix typos and cosmetic issuesMartin Michlmayr2020-05-171-1/+1
|
* MAINT: simplify code that assumes str/unicode and int/long are different ↵Eric Wieser2020-03-261-9/+9
| | | | | types (#15816) Cleanup from the dropping of python 2
* Merge pull request #15534 from seberg/deprecate-abstract-scalar-typesMatti Picus2020-03-061-7/+11
|\ | | | | DEP: Do not allow "abstract" dtype conversion/creation
| * DEP: Do not allow "abstract" dtype conversion/creationSebastian Berg2020-02-061-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | BUG, MAINT: Stop using the error-prone deprecated Py_UNICODE apisEric Wieser2020-02-081-19/+0
|/ | | | | | | | 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
* MAINT/DOC: Remove use of old Python __builtin__, now known as builtinsMike Taves2020-01-241-1/+1
|
* DOC: Updating Chararry Buffer datatypes #15360MLK972020-01-231-1/+1
|
* DOC: Updating Chararry Buffer datatypes #15360MLK972020-01-231-1/+1
|
* [MAINT] Cleanup python2 sys.version checksSeth Troisi2020-01-201-2/+2
|
* MAINT: cleanup sys.version dependant codeSeth Troisi2020-01-121-16/+9
|
* MAINT: Remove unnecessary 'from __future__ import ...' statementsJon Dufresne2020-01-031-2/+0
| | | | | As numpy is Python 3 only, these import statements are now unnecessary and don't alter runtime behavior.
* Fix typos, via a Levenshtein-style correctorBrian Wignall2019-12-191-2/+2
|
* DOC: convert `None` to bare None or ``None``mattip2019-10-151-5/+5
|
* DEP: Complete deprecation of invalid array orderSeth Troisi2019-09-261-1/+1
| | | | | Fixed order=FORTRAN in docs Added release snippet
* ENH: Radix sortHameer Abbasi2019-05-111-1/+1
|
* DOC: reduce warnings when building, reword, tweak doc buildingmattip2019-02-281-1/+1
|
* MAINT: addressing review commentsTyler Reddy2018-12-141-1/+1
| | | | | | | | | | | | | | | | | | | | | * 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
* MAINT: address several reviewer commentsTyler Reddy2018-12-141-1/+1
|
* TST, DOC: enable refguide_checkTyler Reddy2018-12-141-39/+23
| | | | | | | | * 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
* ENH: set correct __module__ for objects in numpy's public APIStephan Hoyer2018-11-131-0/+2
| | | | | | | | | | | | | 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 :).
* MAINT: set preferred __module__ for numpy functionsStephan Hoyer2018-10-231-1/+6
|
* SpellingStephan Hoyer2018-10-121-2/+2
|
* ENH: __array_function__ for np.core.defchararrayStephan Hoyer2018-10-111-0/+149
|
* ENH: don't show boolean dtype, as it is impliedEric Wieser2017-11-131-2/+2
|
* DOC: fix minor docstring typosCJ Carey2017-03-171-2/+2
|
* MAINT: Other cleanup Python < 2.7 and Python3 < 3.4Alexandr Shadchin2016-12-091-11/+1
|
* DOC: change Numpy to NumPy in dosctrings and commentsPierre de Buyl2016-09-061-7/+7
| | | | The strings in error messages were left untouched
* MAINT: Fix some pyflakes warnings in numpy/core/*.pyCharles Harris2015-07-051-11/+12
| | | | | | | | | 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.