You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is probably a crazy idea (and I don't currently have a use case), but could we make it easy to apply a dict to map values? For example, to make the following easier and more reliable (i.e., not rely on inlining the dict):
This requires Numba to know the types of the dictionary. Also, I don't know how easy it would be to have a default value. This may require its own method.
This is inspired by the Pandas functionality to be able to use x.map(d) to apply a dict or Series mapping.
The text was updated successfully, but these errors were encountered:
I think using dicts is a bit counter-intuitive here. In the spirit of working with matrix representations, wouldn't we want to express this as a matrix operation (via permutation matrix, that could be constructed from dict)?
Thanks for reading our issues and commenting @SultanOrazbayev :)
My initial description of and examples for this operation confused @jim22k too. See more discussions in #257
For example, say you wanted to change all 2 values in your matrix to 4 (and let's ignore what happens to the other values for now). This issue proposes "applying a dict mapping" as e.g. A.applymap({2: 4}).
Make sense? We're not doing a permutation, and we're not treating the dict as a matrix.
This is probably a crazy idea (and I don't currently have a use case), but could we make it easy to apply a dict to map values? For example, to make the following easier and more reliable (i.e., not rely on inlining the dict):
This requires Numba to know the types of the dictionary. Also, I don't know how easy it would be to have a default value. This may require its own method.
This is inspired by the Pandas functionality to be able to use
x.map(d)
to apply a dict or Series mapping.The text was updated successfully, but these errors were encountered: