bluesmoon / node-faststats

Quickly calculate statistics of a running stream of data
https://npmjs.org/package/fast-stats
Other
192 stars 19 forks source link

Question about distribution() #9

Closed rogierschouten closed 9 years ago

rogierschouten commented 9 years ago

Hi, and thanks for creating this module! Very handy.

The README says that the distribution() function returns a sparse array with undefined values for empty buckets. However, the example right below checks for buckets with count === 0, so apparently empty buckets are supposed to be defined. Which is it?

Kind regards, Rogier

bluesmoon commented 9 years ago

It is a sparse array. Perhaps the example is incorrect.

rogierschouten commented 9 years ago

From tests, I see that the array is indeed sparse but that zeroes in the middle are present, i.e. only the outer ends are chopped off. So the example is correct as well. Thank you.