I have a function that takes the argument NBins. I want to make a call to this function with a scalar 50 or an array [0, 10, 20, 30].
NBins
50
[0, 10, 20, 30]
Is there an equivalent to isscalar() in numpy? Yes.
>>> np.isscalar(3.1) True >>> np.isscalar([3.1]) False >>> np.isscalar(False) True