bundles / numpy 2.4.4 / numpy / str_
class
numpy:str_
source: /numpy/__init__.py
Signature
class str_(value = '', /, *args, **kwargs)Summary
A unicode string.
Extended Summary
This type strips trailing null codepoints.
>>> s = np.str_("abc\x00") >>> s 'abc'
Unlike the builtin str, this supports the python:bufferobjects, exposing its contents as UCS4:
>>> m = memoryview(np.str_("abc")) >>> m.format '3w' >>> m.tobytes() b'a\x00\x00\x00b\x00\x00\x00c\x00\x00\x00'
- Charactercode
'U'
Aliases
numpy.str_