elephant.statistics.isi(spiketrain, axis=- 1)[source]

Return an array containing the inter-spike intervals of the spike train.

Accepts a neo.SpikeTrain, a pq.Quantity array, a np.ndarray, or a list of time spikes. If either a neo.SpikeTrain or pq.Quantity is provided, the return value will be pq.Quantity, otherwise np.ndarray. The units of pq.Quantity will be the same as spiketrain.

Visualization of this function is covered in Viziphant: viziphant.statistics.plot_isi_histogram().

spiketrainneo.SpikeTrain or pq.Quantity or array-like

The spike times.

axisint, optional

The axis along which the difference is taken. Default: the last axis

intervalsnp.ndarray or pq.Quantity

The inter-spike intervals of the spiketrain.


When the input array is not sorted, negative intervals are returned with a warning.


>>> from elephant import statistics
>>> statistics.isi([0.3, 4.5, 6.7, 9.3])
array([4.2, 2.2, 2.6])