Nothing goes wrong : My question is sage has already lot of functions which don't need numpy, but if there is one function which needs numpy I will have to add it. And arange needs np then I am asking if there a way to do it in sage without using numpy, I am not an expert in sage and I try to keep to pure command, I don't like to import lot of libs as they are already declare in sage, I think is redondant... Then I just wanted to know if there a way of doing np.arange but only with sage (not importing numpy), for example matplolib uses lot of declaration like plt... when i do a plot I only use plot(), I prefer look to sage plot commands (even if they are from matplotlib) that's why I appreciate sage, for latex it's very easy to have it straight because the libs are in sage.  I use sage to do lot of work maths graphs draw music ... etc, then I just add them with sage -pip and after I have nothing to remenber for me sage is a kind of wisiwigsage all-in-one. I am a user not a developer (pity for me... I would like to know this better), sage is the best tool for math in my way. Easy, well documented and much more... I do a lot of things (maybe not academic) but suiting to my needs... At the moment I am in antic chinese music and this requires geometry / music / math... sage do all :)

Regards

Henri



Le 09/01/2018 à 13:34, Simon King a écrit :
Hi,

On 2018-01-09, Girard Henri <henri.gir...@gmail.com> wrote:
Am 09.01.2018 um 12:18 schrieb Girard Henri:
An exemple

from matplotlib import pyplot as plt
from scipy.io import wavfile
import numpy as np
samplerate,data=wavfile.read("test.wav")
times=np.arange(len(data))/float(samplerate)
plt.plot(data[:1000])
What exactly goes wrong if you do the above in Sage? Please be more
specific.

In another message to me, you wrote:
Most of the time I don't want to make heavier "import"... First because
I don't master it and it's much better to do sqrt() instead np.sqrt() or
np.pi()
I don't see why sqrt() is better than np.sqrt().

Anyway, as usual in Python, you can import functions like this:
   sage: from numpy import sqrt
   sage: sqrt
   <ufunc 'sqrt'>
   sage: sqrt(4)
   2.0
   sage: type(_)
   <type 'numpy.float64'>

The disadvantage is that it overwrites Sage's sqrt() function. That's why
I believe it is better to do np.sqrt().

Best regards,
Simon


--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to