We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b118a06 commit 0bba73cCopy full SHA for 0bba73c
python/rapidstats/bin.py
@@ -194,6 +194,20 @@ def sqrt(x: ArrayLike) -> int:
194
195
196
def auto(x: ArrayLike) -> int:
197
+ """Determines the bin count by first using the Freedman Diaconis rule. Since the
198
+ rule may return a pathologically large number of bins, if Freedman Diaconis returns
199
+ a number of bins greater than the square root of the number of observations, use
200
+ Doane's rule.
201
+
202
+ Parameters
203
+ ----------
204
+ x : ArrayLike
205
206
+ Returns
207
+ -------
208
+ int
209
+ Bin count
210
+ """
211
fd = freedman_diaconis(x)
212
213
if fd >= sqrt(x):
0 commit comments