[SciPy-user] new scipy and __future__ division?
Andrew Jaffe
a.h.jaffe at gmail.com
Sat Oct 22 14:18:53 EDT 2005
Travis Oliphant wrote:
> Andrew Jaffe wrote:
>
>>Hi All-
>>
>>I regularly use 'from __future__ import division' in my code, since I
>>can never be sure that my floats don't come to me looking like
>>integers.
>>
>>However, scipy seems to have a problem with this: when I try to divide
>>a float64 scipy array by a float, I get errors like
>>
>>TypeError: unsupported operand type(s) for /: 'scipy.ndarray' and 'float'
>>
>>I don't know if this is a newly-introduced bug (it is a bug, right?
>
> Yes, this is a bug.
>
> Could you please post a small snippet of code that produces the problem
> on your computer. My simple tests don't reproduce it.
>
> Please print
>
> scipy.__core_version__
>
> for comparison purposes as well.
The attached code produces the bug following, on both Mac OSX 10.4 and
RHEL Linux, each running Python 2.4.1. Note that I haven't tried to
simplify the offending set_Cinv routine any further.
snowleopard:~...stats/MCMC% python ~/div_err.py
SciPy Core version= 0.4.2.1252
Traceback (most recent call last):
File "/Users/jaffe/div_err.py", line 25, in ?
a.set_Cinv()
File "/Users/jaffe/div_err.py", line 18, in set_Cinv
dtype=float64)/det
TypeError: unsupported operand type(s) for /: 'scipy.ndarray' and 'float'
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: div_err.py
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20051022/f2ab0cc1/attachment.ksh>
More information about the SciPy-User
mailing list