numpy.r_[True, False] is not a boolean array
Hello, I observe the following behavior: numpy.r_[True, False] -> array([1, 0], dtype=int8) numpy.r_[True] -> array([ True], dtype=bool) I would expect the first line to give a boolean array: array([ True, False], dtype=bool) Is it normal? Is it a bug? -- O.C. numpy.__version__ = '1.4.1'
On Fri, Dec 3, 2010 at 6:29 AM, oc-spam66 <oc-spam66@laposte.net> wrote:
Hello,
I observe the following behavior:
numpy.r_[True, False] -> array([1, 0], dtype=int8) numpy.r_[True] -> array([ True], dtype=bool)
and
np.r_[[True], [False]] array([ True, False], dtype=bool)
np.r_[[True, False]] array([ True, False], dtype=bool)
I would expect the first line to give a boolean array: array([ True, False], dtype=bool)
Is it normal? Is it a bug?
Looks like a bug to me. Josef
-- O.C. numpy.__version__ = '1.4.1' _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
participants (2)
-
josef.pktd@gmail.com
-
oc-spam66