Ask Your Question
1

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

asked 2015-04-01 11:13:24 +0100

terrachild gravatar image

updated 2015-04-01 12:00:25 +0100

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?

Thanks

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2015-04-01 12:10:43 +0100

Thomas gravatar image

updated 2015-04-01 12:11:12 +0100

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

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.

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

Stats

Asked: 2015-04-01 11:13:24 +0100

Seen: 1,189 times

Last updated: Apr 01 '15