The numpy.strings
module provides a set of universal functions operating on arrays of type numpy.str_
or numpy.bytes_
. For example,
>>> np.strings.add(["num", "doc"], ["py", "umentation"]) array(['numpy', 'documentation'], dtype='<U13')
These universal functions are also used in numpy.char
, which provides the numpy.char.chararray
array subclass, in order for those routines to get the performance benefits as well.
Note
Prior to NumPy 2.0, all string functionality was in numpy.char
, which only operated on fixed-width strings. That module will not be getting updates and will be deprecated at some point in the future.
The numpy.strings
module also exports the comparison universal functions that can now operate on string arrays as well.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4