-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
python3 error #23
Comments
I have the same issue Can we get the version of numpy and scipy that were used for testing the package? Also what python 3 version? |
Hopefully this isn't dead...but heres my versions numpy: 1.15.1 |
I too have the same issue (using python 3.7.2, pyDOE 0.3.8). This led me to do some digging. The error stems from the fact that Python 3.x updated the behavior of division. Dividing two ints now produces a float. PEP 238: https://www.python.org/dev/peps/pep-0238/ # python 3.7.2
>>> 1/2
0.5 If you want to continue using floor division in python 3.x then you use the # python 3.7.2
>>> 1//2
0 The nice thing is that the It'll work if you change range_repeat = np.prod(levels)
for i in range(n):
range_repeat //= levels[i] # updated from range_repeat /= levels[i] It looks like #8 was created to fix the same problem that manifested itself slightly differently. The solution was merged into master with PR #20. However, as #19 calls out, the update has not been released to PyPI (nor has the version been incremented in
import pyDOE2 as pyDOE @tisimst |
From @Cruti comments and because I'm using python 3. The current solution is to uninstall pyDOE and install pyDOE2. |
hi my dear friend,I use pyDoe2 and everything be fine. Thank a lot ! |
(doe) LC25423:Envs corti938$ ipython
Python 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 12:04:33)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.1.1 -- An enhanced Interactive Python. Type '?' for help.
In [1]: from pyDOE import *
In [2]: import pyDOE
In [3]: pyDOE.version
Out[3]: '0.3.8'
In [4]: fullfact([2, 3])
TypeError Traceback (most recent call last)
in
----> 1 fullfact([2, 3])
~/my_codes/Envs/doe/lib/python3.6/site-packages/pyDOE/doe_factorial.py in fullfact(levels)
76 for j in range(levels[i]):
77 lvl += [j]level_repeat
---> 78 rng = lvlrange_repeat
79 level_repeat *= levels[i]
80 H[:, i] = rng
TypeError: can't multiply sequence by non-int of type 'numpy.float64'
The text was updated successfully, but these errors were encountered: