you get a vector of vectors if that is what you want, but if you specify that the elements should be of type Array (what you do when you say Array[...]) you get a vector of arrays. Not sure if that was the problem?
I already see it coming (like with NumPy): even using NumPy for more than 10 years I cannot use a NumPy function without looking it up. Everything is so counter intuitive.
Why? T[] with T being a type is syntax for creating a vector that can hold any valid T. If T is Array it will be able to hold any Array, if T is Vector it will be able to hold any Vector.
By explicitly specifying the element type you’re overriding the automatically inferred type, making it less specific.
The distinction is important, and comes up everywhere in practical coding (and definitely not mainly in linear algebra). Matlab’s failure to distinguish these two is a terrible mistake, that constantly creates problems for Matlab users.
IDL data language also does not make a distinction between vectors and arrays as far as I know.
IDL is less used in physics and engineering but was (less so these days) a big player in astrophysics and Earth satellite image processing.
NumPy also has no vectors. And if I convert a list of numbers to a NumPy array I have no idea if NumPy thinks it has to deal with a vector from that moment onwards. It is actually pain.
Julia follows semantic versioning, which means that minor version updates are backwards compatible. Code that worked on v1.0 must work on 1.8, etc. If a new version is introduced that breaks backwards compatibility, then the major version must be updated. In other words, Julia is backwards compatible until v2.0, whenever that might be.
“Backwards compatibility” does not mean “nothing changes”. If it did, then what would be the point of new development? Just make a final version, and stop developing. If you dislike changes, pick a version you like, and never update.
Tutorials based on versions before the first stable release, v1.0, may be broken, but tutorials based on newer versions should not be. If they are, there’s a problem with the tutorial itself.
I presume you mean it doesn’t distinguish vector and matrix. Vectors are a type of array, as is matrix, but they are different. I don’t know IDL, but I linked to a post where I explain why this is bad.
I should have said “rarely comes up in practice for me”. I don’t claim to be typical in my uses, my point was that there’s clearly a (well thought out) reason for the way things are done, and after a bit of initial confusion on my part, it rarely causes me problems. And when it does, I just put a vec() on it and it works out fine .
Maybe you don’t use Matlab Julia takes care of the distinction for you, so you basically rarely have to think about it. In Matlab, you must always be aware of this, and constantly check explicitly whether you are working with rows or columns.
Perhaps you mean they are not called “vector”? But the point is that you never have to wonder whether to represent a vector as a row or a column. Just always use a flat 1d array.
I don’t use much of anything other than Julia these days, though I used to do more python/R. But in python I rarely had need of something more performant then a list, and in R it was basically just “read in the CSV and plot it.”
Both are correct syntactically, but they do different things. A Vector is a “flat” collection of items. An Array is a collection of items with “rectangular” shape (of arbitrary dimensionality). A Vector is a kind of Array; a Matrix is also a kind of Array; a 3-dimensional array is also an Array; etc. There is a type hierarchy in julia, and you can use it to confirm that, e.g., Vector is a subtype of Array (written Vector <: Array). Furthermore, a matrix is not the same as a vector-of-vectors (see my reply to an earlier comment of yours below).
T[a, b, c] creates a Vector{T} (a vector that holds things of type T) with elements a, b, and c. [a, b, c] creates a vector where T is inferred from the elements to be the most specific it can be. If a different T is provided, then the vector is initialized to hold that T instead. See:
This is incorrect. In all languages that have a multi-dimentional array type, such an array must be “rectangular”. That is, all rows must have the same number of elements; likewise for columns. You cannot have a row of 3 followed by a row of 4. In order to store something like that, you must use an array-of-arrays, which is not the same thing. Since they are not the same thing, and they have vastly different uses, guarantees, and performance trade-offs, it make sense for a language to be able to represent both types, and many languages have done so long before julia.
No, an array does not have to be nested. It can contain any type of data, including plain numbers. So [1,2,3] is an array, too, as is a matrix, [1 2 3; 4 5 6], etc.
The point of Array is that it is very general, and be either flat or nested, be of any dimension, (0, 1, 2, 3, …, N, …), and contain any type of elements you want.
julia> [1,2,3] isa Array
true
julia> [1 2 3; 4 5 6] isa Array
true
julia> [[1,2], [3 4; 5 6], 8, "Hello"] isa Array
true