Ask Your Question

Sage nb code won't run now: vector.transpose() throws error.

asked 2015-04-01 04:13:24 -0500

terrachild gravatar image

updated 2015-04-01 05:00:25 -0500

tmonteil gravatar image

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?


edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2015-04-01 05:10:43 -0500

Thomas gravatar image

updated 2015-04-01 05:11:12 -0500

It 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)))





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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2015-04-01 04:13:24 -0500

Seen: 255 times

Last updated: Apr 01 '15