What is the difference between a 0-d array and a scalar?
I thought they were the same thing until I saw the part at 4:21 where it says "This output is a 0-D array, rather than a scalar"
And then at 6:19 all the outputs (after using the squeeze method) returned as scalars. I am confused. Are 0-D arrays and scalars different?


1 answers ( 0 marked as helpful)
After some research, here is what I got
Mathematically, no, you can think of them as the same
However, from NumPy point of view, yes, they are different
please check this
why-are-0d-arrays-in-numpy-not-considered-scalar