Top "Boolean" questions

A Boolean data type is a data type with only two possible values: true or false.

How to toggle a boolean?

Is there a really easy way to toggle a boolean value in javascript? So far, the best I've got outside …

javascript boolean toggle
Is False == 0 and True == 1 an implementation detail or is it guaranteed by the language?

Is it guaranteed that False == 0 and True == 1, in Python (assuming that they are not reassigned by the user)? For instance, …

python boolean equality language-specifications
Converting string "true" / "false" to boolean value

I have a JavaScript string containing "true" or "false". How may I convert it to boolean without using the eval …

javascript boolean
How do I use boolean variables in Perl?

I have tried: $var = false; $var = FALSE; $var = False; None of these work. I get the error message Bareword "false" …

perl boolean
How to convert a boolean array to an int array

I use Scilab, and want to convert an array of booleans into an array of integers: >>> x = …

python integer boolean type-conversion scilab
How to count the number of true elements in a NumPy bool array

I have a NumPy array 'boolarr' of boolean type. I want to count the number of elements whose values are …

python arrays numpy count boolean
Convert boolean result into number/integer

I have a variable that stores false or true, but I need 0 or 1 instead, respectively. How can I do this?

javascript numbers integer boolean type-conversion
How to create a numpy array of all True or all False?

In Python, how do I create a numpy array of arbitrary shape filled with all True or all False?

python arrays numpy boolean numpy-ndarray
Best approach to converting Boolean object to string in java

I am trying to convert boolean to string type... Boolean b = true; String str = String.valueOf(b); or Boolean b = …

java boolean
Logical operators for boolean indexing in Pandas

I'm working with boolean index in Pandas. The question is why the statement: a[(a['some_column']==some_number) & (…

python pandas dataframe boolean filtering