Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 88283

NumPy is the fundamental package for scientific computing with the programming language Python.

5 votes
2 answers
2k views

Finding cells in a 3D grid with free neighbors

Perhaps an all-numpy solution would be faster. … The indices can be returned in two formats, as specified by the docstring, which can be helpful for some numpy-functions. …
tsorn's user avatar
  • 285
1 vote

Finding cells in a 3D grid with free neighbors

One improvement, with bitwise or: def get_free2(cell): """ Return the indices of a a cell that are 0 and where all its neighbors are 0 for the same depth """ neighs = neighbors2( …
tsorn's user avatar
  • 285
2 votes
1 answer
94 views

Performance optimization when switching from nested to flat representation (genetic algorithm)

from itertools import chain from timeit import timeit import logging import numpy as np class Number: def __init__(self, value=None): if value: self.value = value else …
tsorn's user avatar
  • 285
3 votes
0 answers
47 views

Deriving incremental feature representations for bit flips

Below the code is some background which is not required reading but may make things more concrete. import functools from enum import Enum from timeit import timeit import numpy as np class Action(Enum …
tsorn's user avatar
  • 285