Removed the format_histogram functions, as they were using unsupported string formatting. Maybe when Ignitions’s Jython gets upgraded, I can look at it again.
Renamed remaining histogram function to histogram. Brevity is good.
Added ‘raw’ flag to histogram function to give a one-dimensional list with repeat histogram values, instead of a list of (value, count) tuples.
added mode and all_modes functions. Read the doc for more info.
Don't do this. After this executes on this module's load, if shared.statsutils is updated, this module won't get the changes. You should always use spelled-out names for shared.* and project.* functions and objects. Don't import them.
I finally had a chance to play around with this code. I think I like the math.mode function that I came up with best for calculating modes. Or at least, matches what excel will give me for a mode on values rounded to 3 digits.
With the statsutils version, I have to try to calculate the number of bins ahead of time to get a fine-grained enough binning. With the other method, the bins are auto-created as needed, so to speak.
I’ll definitely be using the statsutils for other statistical functions though! Very useful stuff!