I can't seem to find the issue here that I am getting out of range issue:
layerZ = [layer_1,layer_2,layer_3,layer_4,layer_5,layer_6,layer_7,layer_8,layer_9,layer_10,layer_11,layer_12,layer_13]
for x in range(0, 12):
layerZ_total = [np.size(layerZ[x])]
layerZ_sp = [np.count_nonzero(layerZ[x]==0)]
layerZ_nonSp = [np.count_nonzero(layerZ[x])]
#Printing the results on scree to trace
print "Layer:",x+1,"Threshhold:",repr(ths),"Total Parameters: ",layerZ_totParam[x],"# Sp: ",layerZ_sp[x],"# Remained : ",layerZ_nonSp[x],"Sp %: ",float(layerZ_sp[x])/layerZ_total[x]
layerZ_total,lazerZ_spandlayerZ_nonSplists all have length 1, because you create them from scratch each iteration. They therefor can't have any other indices than0, but you usedxto index them.layerZ_total[x]=...for all of them then. right?