bundles / numpy 2.5.0.dev0+git20251130.2de293a / numpy / lib / _iotools / str2bool
function
numpy.lib._iotools:str2bool
source: build-install/usr/lib/python3.14/site-packages/numpy/lib/_iotools.py :386
Signature
def str2bool ( value ) Summary
Tries to transform a string supposed to represent a boolean to a boolean.
Parameters
value: strThe string that is transformed to a boolean.
Returns
boolval: boolThe boolean representation of
value.
Raises
: ValueErrorIf the string is not 'True' or 'False' (case independent)
Examples
import numpy as np np.lib._iotools.str2bool('TRUE') np.lib._iotools.str2bool('false')✓
Aliases
-
numpy.lib._iotools.str2bool