Last answered:

04 Oct 2022

Posted on:

30 Nov 2021


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)
Posted on:

04 Oct 2022


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

Submit an answer