[SciPy-user] new scipy and __future__ division?
a.h.jaffe at gmail.com
Sat Oct 22 13:18:53 CDT 2005
Travis Oliphant wrote:
> Andrew Jaffe wrote:
>>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
>>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
> 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 ?
File "/Users/jaffe/div_err.py", line 18, in set_Cinv
TypeError: unsupported operand type(s) for /: 'scipy.ndarray' and 'float'
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
More information about the SciPy-user