Back to Community
Lecture Series Mode of Bins Explained

Could someone please explain this line of coding from the Lecture Series: Means.

print 'Mode of bins:', [(bins[i], bins[i+1]) for i, j in enumerate(hist) if j == maxfreq]

perhaps a noob question but I can't figure out why basically any of this makes sense; why i+1 has been used, and what the last part of j==maxfreq is doing.