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

Why am i getting a type error? #7

Open
NET-OF-BEING opened this issue Jun 21, 2018 · 1 comment
Open

Why am i getting a type error? #7

NET-OF-BEING opened this issue Jun 21, 2018 · 1 comment

Comments

@NET-OF-BEING
Copy link

Im using python 3.6.5 and receiving the following Error.

Traceback (most recent call last):
File "conway.py", line 40, in
A = conway(A)
File "conway.py", line 16, in conway
k[m/2-1 : m/2+2, n/2-1 : n/2+2] = np.array([[1,1,1],[1,0,1],[1,1,1]])
TypeError: slice indices must be integers or None or have an index method

@wsyxbcl
Copy link

wsyxbcl commented Mar 27, 2019

Im using python 3.6.5 and receiving the following Error.

Traceback (most recent call last):
File "conway.py", line 40, in
A = conway(A)
File "conway.py", line 16, in conway
k[m/2-1 : m/2+2, n/2-1 : n/2+2] = np.array([[1,1,1],[1,0,1],[1,1,1]])
TypeError: slice indices must be integers or None or have an index method

Since slice indices should be integers here, changing '/' to '//' here will fix the issue.
k[m//2-1 : m//2+2, n//2-1 : n//2+2] = np.array([[1,1,1],[1,0,1],[1,1,1]])

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

2 participants