Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 16862

Python: Differentiating between row and column vectors

$
0
0

Is there a good way of differentiating between row and column vectors in numpy? If I was to give one a vector, say:

from numpy import *v = array([1,2,3])

they wouldn't be able to say weather I mean a row or a column vector. Moreover:

>>> array([1,2,3]) == array([1,2,3]).transpose()array([ True,  True,  True])

Which compares the vectors element-wise.

I realize that most of the functions on vectors from the mentioned modules don't need the differentiation. For example outer(a,b) or a.dot(b) but I'd like to differentiate for my own convenience.


Viewing all articles
Browse latest Browse all 16862


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>