Adam Davison added the comment:
Thanks for the quick response. I'm really using a pandas Series, which is
effectively a numpy array behind the scenes as far as I understand, the example
I pasted was just to illustrate the behaviour. So the nans are being produced
elsewhere, I don
New submission from Adam Davison:
If you pass an array containing nan to collections.Counter, rather than
counting the number of 'nan's it outputs "'nan': 1" n times into the
dictionary. I appreciate using this on an array of floats is a bit of an
unusual case