-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Give suggestions for vector->row vector confusion #7688
Conversation
+1 |
I was very confused by this when I was learning, + a lot |
I like the idea of giving a clear message. |
The build failure seems unrelated (even though it seems scary that it is the |
Maybe point to the |
Does anyone have any objections against this, or should I just squash and merge? |
Nice implementation. One small nit: it might be better to say you can convert Arrays to a vector using |
I think it should be ok to squash and merge. |
I don't think it suggests I think it is more important to stress the type difference between row and column vectors in Julia, than to provide a complete description of what |
I agree that the clarification of row vs column (and space vs comma) much needed---this comes up over and over, and it will be great to have this fixed in such a good, general way. I was just suggesting converting |
Yes, that seems better. I did not like the reference to Array in the first suggestion. |
Wrong button 😠 |
Some new users might get confused when they create a vector without commas, and end up with a matrix that does not match the methods he tries to use. After this patch the error will contain a suggestion. ```julia julia> a = [1 2 3] 1x3 Array{Int64,2}: 1 2 3 julia> sort(a) ERROR: `sort` has no method matching sort(::Array{Int64,2}) You might have used a 2d row vector where a 1d column vector was required. Note the difference between 1d column vector [1,2,3] and 2d row vector [1 2 3] You can convert to a column vector with the vec() function ```
Give suggestions for vector->row vector confusion
Looks like this version omitted the mention of |
Never mind, this was a wait-for-GitHub-to-update issue. |
Sorry, somehow git happily does a |
Some new users might get confused when they create a vector without
commas, and end up with a matrix that does not match the methods he
tries to use. After this patch the error will contain a suggestion.
See: https://groups.google.com/forum/#!topic/julia-users/XBjl1sPfTkU and #7512
Suggestions for better wording/formatting is most welcome.