Wrong values calculating FFT with EEG Bands using Numpy
There are a few things going on:
1.) Your data is actually only length 5 (made up of 5 longer components). This means when you call fft_freq = np.fft.rfftfreq(len(data), 1.0/fs) your array containing the frequencies of the FFT is only length 3! I think the main issue I'm having is that I'm not sure what your data actually represents: multiple electrodes?
2.) I think you're using np.where wrong. Basically it's not returning a slice which appears to be what you're trying to get.
3.) Even if a single array in your data represents an FFT of a single channel, the length is not nearly long enough to get anything useful. If we take the frequencies of data[0] we get [  0.   12.5  25.   37.5  50.   62.5  75.   87.5 100. ]. Not even one bin per band so you need to increase the length of your data. This is probably why freq_ix returns an empty array sometimes.
I was basically doing the same thing here in lines 45-68. A little different but more or less the same idea.
Also highly recommend using the MNE package. :)