This used to raise an IndexError instead of a ValueError.  I don't know if we care really.  I'm not even convinced that just silently returning all zeros for in this case would be a bad thing.  It would let things like `np.gradient(np.array([[0,1,2,3,4]]))` work.