Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialNicole Buckenwolf
8,721 PointsCan someone help me understand this quiz answer? NumPy arrays scalar/vector
I'm working on the Introduction to NumPy course in the beginning data science track and am hoping someone can help me understand this quiz question "Since they are often used in mathematical equations, what is the common synonym for single dimension arrays?"
I selected scalar
and got it wrong, the quiz says "Bummer! Whoops! Close this is the singular value, vector
is used for multiple values."
The question is asking about single dimension arrays so I assumed the answer would refer to the singular value - can someone explain what I am missing here? Thanks.
2 Answers
Travis Alstrand
Treehouse Project ReviewerHiya Nicole Buckenwolf !
I totally understand the confusion on this one, I'll try my best here but it's hard for me to put into the right words.
Scalars are used to represent single values, such as a single number.
In the context of arrays, a vector typically refers to a one-dimensional array, which contains a sequence of values along a single axis.
A matrix is a two-dimensional array (or more than 2 if I remember correctly).
So the reason Scalar didn't work is because it's referring to a single value, whereas a vector pertains to arrays.
Nicole Buckenwolf
8,721 PointsThat makes sense, thank you for breaking it out like that!
Travis Alstrand
Treehouse Project ReviewerYou're very welcome! 😃