At bit OT, but I am new to numpy. The help for np.where says:
Returns
-------
out : ndarray or tuple of ndarrays
If both `x` and `y` are specified, the output array contains
elements of `x` where `condition` is True, and elements from
`y` elsewhere.
If only `condition` is given, return the tuple
``condition.nonzero()``, the indices where `condition` is True.
However, I don't see any case that it returns an ndarray
(it always seems to return a tuple of ndarrys). It seems to me for the
case where only 'condition' is given it should return just the ndarry,
eg (using this case discussed above):
In [44]: np.where(i==0)
Out[44]: (array([8, 9]),)
This should just return the ndarray and not the tuple of ndarrays. In what case does it only return the ndarray?