ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 01 Apr 2015 12:10:43 +0200Sage nb code won't run now: vector.transpose() throws error.https://ask.sagemath.org/question/26409/sage-nb-code-wont-run-now-vectortranspose-throws-error/I'm trying to run some code I found that someone ran previously on Sage, but now it won't run.
I'm new to Sage, so I'm not sure what to do.
This doesn't work now:
rand_transVector = vector((uniform(-10,10),uniform(-10,10),uniform(-10,10))).transpose()
It says:
AttributeError: 'Vector_symbolic_dense' object has no attribute 'transpose'
Could someone tell me what is wrong, or look at my project?
ThanksWed, 01 Apr 2015 11:13:24 +0200https://ask.sagemath.org/question/26409/sage-nb-code-wont-run-now-vectortranspose-throws-error/Answer by Thomas for <p>I'm trying to run some code I found that someone ran previously on Sage, but now it won't run.
I'm new to Sage, so I'm not sure what to do.</p>
<p>This doesn't work now:</p>
<pre><code>rand_transVector = vector((uniform(-10,10),uniform(-10,10),uniform(-10,10))).transpose()
</code></pre>
<p>It says: </p>
<pre><code>AttributeError: 'Vector_symbolic_dense' object has no attribute 'transpose'
</code></pre>
<p>Could someone tell me what is wrong, or look at my project?</p>
<p>Thanks</p>
https://ask.sagemath.org/question/26409/sage-nb-code-wont-run-now-vectortranspose-throws-error/?answer=26411#post-id-26411It seems that a vector doesn't know if it is a row or a column vector. When you have a vector such as
v = vector((uniform(-10,10),uniform(-10,10),uniform(-10,10)))
then
v.row()
and
v.column()
give it to you as row or column vectors. This must have been a change made to sage since your notebook was created. So to solve your problem, remove the transpose and relpace it with row or column if necessary.Wed, 01 Apr 2015 12:10:43 +0200https://ask.sagemath.org/question/26409/sage-nb-code-wont-run-now-vectortranspose-throws-error/?answer=26411#post-id-26411