This is a pre-release version (latest). Go to latest (2.4.4)
{ } Raw JSON

bundles / numpy latest / numpy / str_

class

numpy:str_

source: /dev/numpy/build-install/usr/lib/python3.14/site-packages/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_

Referenced by