Re: [sympy] sympy.core.numbers.Float with numpy.fft

222 views
Skip to first unread message

krastano...@gmail.com

unread,
Jul 17, 2012, 8:34:02 AM7/17/12
to sy...@googlegroups.com
This is basically a characteristic of numpy. sympy.Float supports the
interfaces required from a float-like object, namely the __float__
method. Numpy does not look for this, so you should explicitly require
numpy to use the float64 dtype.

In [5]: a = sin(1).evalf(), sin(2).evalf()
In [6]: np_a = np.array(a, dtype=np.float64)

krastano...@gmail.com

unread,
Jul 17, 2012, 8:35:06 AM7/17/12
to sy...@googlegroups.com
And sympy has a new plotting module that may fulfill your needs. Check
it out if you are interested. It is in our git repository.

Alan Martinovic

unread,
Jul 18, 2012, 2:28:53 PM7/18/12
to sy...@googlegroups.com
Thanx for the replay. I'm using your solution.

As for the plotting module, i'm trying to settle down with matplotlib.

krastano...@gmail.com

unread,
Jul 18, 2012, 2:56:58 PM7/18/12
to sy...@googlegroups.com
> As for the plotting module, i'm trying to settle down with matplotlib.
Good idea. That is why the plotting module actually uses matplotlib.
It just does all the evaluations, etc automatically for you (in a
faster manner than what you get by using .evalf())
Reply all
Reply to author
Forward
0 new messages