Hello all.

I am (relatively) new to python, and 100% new to numpy.

I need a way to store arrays of booleans and compare the arrays for
equality.

I assume I want arrays of dtype Boolean, and I should compare the arrays
with array_equal

>>> tmp.all_states
array([False,  True, False], dtype=bool)
>>> tmp1.all_states
array([False, False, False], dtype=bool)
>>> tmp1.all_states[1]=True
>>> tmp1.all_states
array([False,  True, False], dtype=bool)
>>> array_equal(tmp.all_states,tmp1.all_states)
True
>>> any(tmp.all_states)
True

Would this be (a) the cheapest way (w.r.t. memory) to store Booleans and (b)
the most efficient way to compare two lists of Booleans?

Thanks for your advice.
-JJ.
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to