Why is it wrong?
Edit: typo
Why is it wrong?
Edit: typo
Amusingly this also leads to things like
x = 1
x(end+1) = 2
x == [1 2]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.
That's my point. Have you ever used a proper tensor? I mean, the mathematical entity: https://en.wikipedia.org/wiki/Tensor
[Edit: You may care about vector algebra but 99.999% of the users of numerical arrays do not. I just think that the proper term in a general discussion about data structures in numerical computing like the one here is “array”.]
[Edit2: in case you’re really not familiar with the abuse of the term, people do now often use the word tensor to talk about multidimensional arrays that have nothing to do with the mathematical entity called tensor. And I don’t think either matlab or python pretend that they have tensors.]