Ask Your Question

dr's profile - activity

2023-05-02 04:09:22 +0200 received badge  Notable Question (source)
2020-05-27 08:25:54 +0200 received badge  Popular Question (source)
2015-10-08 17:32:08 +0200 commented answer scalar^[vector]?

Actually, it still doesn't work right.

from numpy import array as npvec
N = 100
angs = -i*2*pi/N*npvec(range(1,N+1))
e.^angs

gives an error. In fact, putting anything in place of e except an integer fails. Even a variable that has an integer value gives an error.

2015-10-08 17:14:13 +0200 commented answer scalar^[vector]?

Can't upvote yet, so thanks!

2015-10-08 16:42:54 +0200 commented answer scalar^[vector]?

Right, I know what numpy is. I just assumed the default python-like interaction I'm doing in a sagecell WAS numpy. Instead it's another language? Or something?

2015-10-08 16:18:52 +0200 commented answer scalar^[vector]?

2.^x

works.

I guess I don't understand the relationship between sage and numpy or scipy or really any of the packages. Why is numpy not the default. What are the implications of doing the import? Are numpy vectors going to interact with the plotting correctly? Etc.

Ugh, I didn't even notice the difference between "through sage" and "with python". .^ works in one and errors in the other, while ^ is the reverse. I don't understand. What document gives a map for how all these things interact?

2015-10-08 11:22:26 +0200 commented answer scalar^[vector]?

That makes writing the function easier, but for readability in the middle of an equation it leaves a lot to be desired.

2015-10-08 11:21:46 +0200 received badge  Scholar (source)
2015-10-08 03:00:55 +0200 received badge  Editor (source)
2015-10-08 03:00:40 +0200 asked a question scalar^[vector]?

I feel really stupid like this should be obvious, but I can't figure out how to do it.

v = vector([1,2,3])
2^v

should give me

[2, 4, 8]

I can't find any other way to do this without writing a function.

2015-03-03 03:25:59 +0200 answered a question Is there a way to get embedded sagecells to autoeval?

nm, I figured it out from the code. is there any documentation of this?

 <script>
  // div.compute turns all "compute" divs into sagecells
  // minimal template means there's no cell editing for the user
  // autoeval means there's no stupid "click here to activate me!" necessary
  // hide: evalButton means the stupid button itself is gone
  $(function() {
     sagecell.makeSagecell({inputLocation: 'div.compute', template: sagecell.templates.minimal, autoeval: true, hide: ['evalButton']});
  });
  </script>
2015-03-03 03:15:17 +0200 received badge  Student (source)
2015-03-03 02:07:07 +0200 asked a question Is there a way to get embedded sagecells to autoeval?

I don't want to have a big "press this button to see the thing" on my page. I just want the interact to be there. I see the javascript has an "autoeval" setting, but I can't figure out how to activate it.