@@ -4858,8 +4858,8 @@ def hexbin(self, x, y, C=None, gridsize=100, bins=None,
48584858 yscale : {'linear', 'log'}, default: 'linear'
48594859 Use a linear or log10 scale on the vertical axis.
48604860
4861- mincnt : int > 0, default: *None*
4862- If not *None*, only display cells with more than *mincnt*
4861+ mincnt : int >= 0, default: *None*
4862+ If not *None*, only display cells with at least *mincnt*
48634863 number of points in the cell.
48644864
48654865 marginals : bool, default: *False*
@@ -4926,6 +4926,11 @@ def reduce_C_function(C: array) -> float
49264926 - `numpy.sum`: integral of the point values
49274927 - `numpy.amax`: value taken from the largest point
49284928
4929+ By default will only reduce cells with at least 1 point because some
4930+ reduction functions (such as `numpy.amax`) will error/warn with empty
4931+ input. Changing *mincnt* will adjust the cutoff, and if set to 0 will
4932+ pass empty input to the reduction function.
4933+
49294934 data : indexable object, optional
49304935 DATA_PARAMETER_PLACEHOLDER
49314936
@@ -5023,7 +5028,7 @@ def reduce_C_function(C: array) -> float
50235028 else :
50245029 Cs_at_i2 [i2 [i ]].append (C [i ])
50255030 if mincnt is None :
5026- mincnt = 0
5031+ mincnt = 1
50275032 accum = np .array (
50285033 [reduce_C_function (acc ) if len (acc ) >= mincnt else np .nan
50295034 for Cs_at_i in [Cs_at_i1 , Cs_at_i2 ]
0 commit comments