SeedRandom[1]
data = Join[RandomReal[1, {300000, 2}], RandomChoice[{0, 1}, {300000, 1}], 2];
Dimensions[data]
{300000, 3}
nbins = 5;
binlims = Through[{Floor[Min@#, .01] &, Ceiling[Max@#, .01] &}@#] & /@ Transpose[data];
{xbins, ybins} = {##, -Subtract[##]/nbins} & @@@ Most[binlims];
binlists = BinLists[data, xbins, ybins, {0, 2, 2}];
binmeans = Flatten /@ Map[Mean, binlists[[All, All, All, All, -1]], {-2}];
cft = Charting`FindTicks[{0, nbins}, {0, 1}];
MatrixPlot[binmeans, DataReversed -> True, ColorFunction -> "Rainbow",
FrameTicks -> {{cft, cft}, {cft, cft}}]
With nbins = 25
we get