@@ -4873,8 +4873,8 @@ def hexbin(self, x, y, C=None, gridsize=100, bins=None,
48734873 yscale : {'linear', 'log'}, default: 'linear'
48744874 Use a linear or log10 scale on the vertical axis.
48754875
4876- mincnt : int > 0, default: *None*
4877- If not *None*, only display cells with more than *mincnt*
4876+ mincnt : int >= 0, default: *None*
4877+ If not *None*, only display cells with at least *mincnt*
48784878 number of points in the cell.
48794879
48804880 marginals : bool, default: *False*
@@ -4941,6 +4941,11 @@ def reduce_C_function(C: array) -> float
49414941 - `numpy.sum`: integral of the point values
49424942 - `numpy.amax`: value taken from the largest point
49434943
4944+ By default will only reduce cells with at least 1 point because some
4945+ reduction functions (such as `numpy.amax`) will error/warn with empty
4946+ input. Changing *mincnt* will adjust the cutoff, and if set to 0 will
4947+ pass empty input to the reduction function.
4948+
49444949 data : indexable object, optional
49454950 DATA_PARAMETER_PLACEHOLDER
49464951
@@ -5038,7 +5043,7 @@ def reduce_C_function(C: array) -> float
50385043 else :
50395044 Cs_at_i2 [i2 [i ]].append (C [i ])
50405045 if mincnt is None :
5041- mincnt = 0
5046+ mincnt = 1
50425047 accum = np .array (
50435048 [reduce_C_function (acc ) if len (acc ) >= mincnt else np .nan
50445049 for Cs_at_i in [Cs_at_i1 , Cs_at_i2 ]
0 commit comments