Closed fjsj closed 4 years ago
Yes. Dict(int, Set(int)) is implemented. I am not sure that I wanted to keep the current api, so consider it alpha stages. However, I use it for a project and I like the interface.
Nice, how can I set values to a MultiDict? Tried this:
s = gp.Set(np.dtype('i8'))
s.add([1,2,3])
m = gp.MultiDict(np.dtype('i8'), np.dtype('i8'))
m[1] = s
But got TypeError
at the last line.
Sorry I forgot to answer this over the weekend.
The syntax for this is:
m = gp.MultiDict(np.dtype('i8'), np.dtype('i8'))
for i in [1,2,3]:
m[1] = i
It will handle the multi-value set automatically. You just add one key-value pair at a time (or vectorized).
Vectorized example:
m = gp.MultiDict(np.dtype('i8'), np.dtype('i8'))
keys = np.array([1,1,1])
values = np.array([1,2,3])
m[keys] = values
Hi, thanks for this lib! I see
MultiDict
is mentioned on the README, but I couldn't find tests for it.Is it already supported? Is it possible to store sets of ints in a
MultiDict
?