A very convenient way to get a quick impression of what the songs of diverse genres "look" like is to draw a spectrogram for a set of songs in a genre. A spectrogram is a visual representation of the frequencies that occur in a song. It shows the intensity for the frequencies on the y axis in the specified time intervals on the x axis. In the following spectrogram, that would mean the brighter the color, the stronger the frequency in the particular time window of the song.
Matplotlib provides the convenient specgram() function, which performs most of the under-the-hood calculation and plotting for us:
>>> import scipy.io.wavfile
>>> from matplotlib.pyplot import specgram
>>> sample_rate, X = scipy.io.wavfile.read(wave_filename)
>>> print(sample_rate, X.shape)
22050, (661794,)
>>> specgram(X, Fs=sample_rate, xextent...