I recently asked a question on Stack Overflow about whether `np.array`
could raise an error if not passed a dtype parameter:
https://stackoverflow.com/q/49639414/2988730.

Turns out it can:

    np.array([1, [2]])

raises `ValueError: setting an array element with a sequence.` Surprisingly
though, the following does not, and gives the expected array with
`dtype=object`:

    np.array([[1], 2])

Is this behavior a bug of sorts, or is there some arcane reason behind it?

Regards,

- Joe
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion

Reply via email to