spiketools.spatial.utils.compute_bin_width

spiketools.spatial.utils.compute_bin_width(bin_edges)[source]

Compute bin width from a set of bin edges.

Parameters:
bin_edges1d array

Bin edges.

Returns:
float

The bin width.

Examples

Compute bin width from an array of 5 bin edges:

>>> bin_edges = [1.5, 3.5, 5.5, 7.5, 9.5]
>>> compute_bin_width(bin_edges)
2.0