{ } Raw JSON

bundles / numpy 2.4.4 / numpy / lib / _iotools / str2bool

function

numpy.lib._iotools:str2bool

source: /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 : str

The string that is transformed to a boolean.

Returns

boolval : bool

The boolean representation of value.

Raises

: ValueError

If 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