2 ms·You could try np.isscalar() and np.array().ndim in NumPy.by happy-go-lucky 9y agoYou could try np.isscalar() and np.array().ndim in NumPy.