4 ms·
when built-in array type is not performant nor serves as an interface (abstract class), it's as if it doesn't exist. I guess the point is Numpy predates Python'
by moelf 4y ago
when built-in array type is not performant nor serves as an interface (abstract class), it's as if it doesn't exist. I guess the point is Numpy predates Python's array by a long shot.
Compare and contrast with languages with built-in N-dimensional array for scientific computing.
- hprotagonist 4y agolike matlab, that lies?
- moelf 4y agoJulia
- tkuraku 4y agoWhat do you mean?
- hprotagonist 4y agoin matlab: >> size(4) ans = 1 1 which is 1. wrong and 2. evidence that matlab cannot represent numerical objects of less than rank 2. Numpy can: >> np.shape(4) ()
- ModernMech 4y agoI'm confused by what you mean. In Matlab, everything is a matrix. A naked integer is a 1x1 matrix, hence why the size is reported as [1 1]. Those are the semantics of the language, not a lie.
- hprotagonist 4y agoa naked integer is not a 1x1 matrix, it’s a 0x0. Matlab silently promotes it to one, though, which is a deliberately misleading thing to do because it’s convenient for matlab’s data model. i think it’s fair to call that a (white) lie
- ModernMech 4y ago> a naked integer is not a 1x1 matrix, it’s a 0x0 Do you have a link to where this is asserted in the documentation? I'm confused as to the basis for this.
- hprotagonist 4y agohttps://mathworld.wolfram.com/TensorRank.html https://mathworld.wolfram.com/TensorRank.html it should be clear that i don’t care very much about what matlab has to represent things as. i don’t mean “matlab integers”, i mean the mathematical objects; matlab’s representation of them is poor.
- ModernMech 4y agoOkay, well that's not Matlab lying, that's you not understanding how the tool works. It would be like saying that 0.1 + 0.2 == 0.3 evaluating to false is a lie, because floating point numbers don't accurately represent real numbers as a concept. But floating point numbers aren't actually real numbers, and integers in Matlab (they're actually stored as floating point doubles, is that a lie too?) aren't actually mathematical objects. You have to work within the constraints of the tool. Matlab makes it very clear upfront that the semantics of the language mean that naked numbers are in fact matrices, because everything in the language is a matrix. Maybe you feel that's not a good representation, but it's not a lie, and in fact it's very consistent and useful in the context of the language itself.
- jwilk 4y ago> Numpy predates Python's array by a long shot I don't think so. The array module was included even in Python 1.0. Or did you mean to use another verb?
- eesmith 4y agoTo be more specific, "git log arraymodule.c" reports: commit 778983b48165da25ee11fb97f6855af7c67f4ff2 Author: Guido van Rossum <guido@python.org> Date: Fri Feb 19 15:55:02 1993 +0000 Added new module "array" (for now optional) defining array objects.