Skip to content
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

TypeError Python 3.5.2 #8

Closed
e-neu opened this issue Mar 15, 2017 · 1 comment
Closed

TypeError Python 3.5.2 #8

e-neu opened this issue Mar 15, 2017 · 1 comment

Comments

@e-neu
Copy link

e-neu commented Mar 15, 2017

Hi,

I get the following TypeError with newer versions of Python. Any suggestions how to fix this?

Kind regards,
e-neu

pyDOE.fullfact([1, 2])

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-65-d26355a11123> in <module>()
----> 1 pyDOE.fullfact([1, 2])

C:\Users\XXX\AppData\Roaming\Python\Python35\site-packages\pydoe-0.3.8-py3.5.egg\pyDOE\doe_factorial.py in fullfact(levels)
     76         for j in range(levels[i]):
     77             lvl += [j]*level_repeat
---> 78         rng = lvl*range_repeat
     79         level_repeat *= levels[i]
     80         H[:, i] = rng

TypeError: 'numpy.float64' object cannot be interpreted as an integer
import sys
sys.version

'3.5.2 |Anaconda custom (64-bit)| (default, Jul 5 2016, 11:41:13) [MSC v.1900 64 bit (AMD64)]'

import pyDOE
pyDOE.__version__

'0.3.8'

@e-neu
Copy link
Author

e-neu commented Mar 15, 2017

Ok, I looked into it and the solution seems to be quite simple. Just change the float division

range_repeat /= levels[i]

into a integer division.

range_repeat //= levels[i]

I've only recently started using Python, so I am not sure how this will affect earlier Python versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant