Input signal for neural network

The first example with the active attribute works in the same way for SpikeMonitor. The rest is a bit different, since you do not have a 2d array, but two 1d arrays for the spike indices and the times. The last approach works almost in the same way, though:

filtered_indices = spike_mon.i[(spike_mon.t >=200*ms) & (spike_mon.t < 300*ms)]
filtered_times = spike_mon.t[(spike_mon.t >=200*ms) & (spike_mon.t < 300*ms)]
# Raster plot of the spikes between 200ms and 300ms:
plt.plot(filtered_times/ms, filtered_indices, '|')

Thank you @mstimberg for the detailed answer!