First time here? Check out the FAQ!

Ask Your Question
1

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

asked 10 years ago

terrachild gravatar image

updated 10 years ago

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

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
1

answered 10 years ago

Thomas gravatar image

updated 10 years ago

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.

Preview: (hide)
link

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: 10 years ago

Seen: 1,302 times

Last updated: Apr 01 '15