Forgot to mention: Some of the suggestions by @stuartarchibald in the related post are relevant here. In particular, drop_elements
should solve my problem 3. I was also trying to use the TupleKeyDict
class defined there to solve my other problems: one idea would be to have filtration
be an int
: TupleKeyDict
dictionary so as to get around the heterogeneity problem. But I have not been able to make something as simple as this work:
@njit
def foo():
d = {}
for i in range(2):
# Create a dictionary to wrap
wrapped_dictionary = Dict.empty(types.intp, types.float64)
# wrap it
d[i] = TupleKeyDict(wrapped_dictionary)
d[i][(1, 2)] = 4.
return d
foo()