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