by hprotagonist · 7y ago · 0 comments
matlab:
size(1)
ans = [1,1]
python: In[0]: np.array(1).shape
Out[0]: ()
0-tensors are not 2-tensors, either. You can read matlab's result as "scalars are matricies that have one row and one column", and that's nonsense -- matlab effectively lacks a scalar numeric type; under the covers, everything is a matrix.what numpy calls it is more or less moot.
This is not a CS data structures 101 thing, this is a "there are proper names for mathematical entities" thing. I think you're confusing representation and existence, maybe.