spiketools.spatial.utils.compute_nbins

spiketools.spatial.utils.compute_nbins(bins)[source]

Compute the number of bins for a given bin definition.

Parameters:
binsint or list of [int, int]

The bin definition for dividing up the space. If 1d, can be integer. If 2d should be a list, defined as [number of x_bins, number of y_bins].

Returns:
n_binsint

The total number of bins for the given bin definition.

Examples

Compute the number of bins for a given bin definition:

>>> compute_nbins(bins=[4, 5])
20