Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • Ooh, that looks good. I can have the key just be the array.tolist(). Thank you! Commented Jan 3, 2015 at 2:28
  • So lists aren't hashable either but I think I can find something. Commented Jan 3, 2015 at 2:41
  • @SoItBegins list and ndarray are mutable -- if you tried to define a hash value of a list it would need to work based on the hash values of the contents of that list -- but if the contents can change because it is mutable, then the hash value could suddenly be wrong for the contents of the array. Commented Jan 3, 2015 at 2:41
  • You're leaving out the detail that you need to set the writeable flag to False -- which is a big deal if you want to mutate these arrays (which I assume is an important point of using them). Commented Jan 3, 2015 at 2:54
  • @prpl.mnky.dshwshr after all is said + done, I've cleaned this up quite a bit and introduced a dict comprehension. Let me know if there are any more comments/concerns. (I'm deleting extraneous comments to clean this up as well) Commented Jan 3, 2015 at 6:05