neuroprob/utils/neural.py
def binned_to_indices(spiketrain):
    """
    Converts a binned spike train into spike time indices (with duplicates)
    
    :param np.array spiketrain: the spike train to convert
    :returns: spike indices denoting spike times in units of time bins
    :rtype: np.array
    """
    spike_ind = spiketrain.nonzero()[0]
    bigger = np.where(spiketrain > 1)[0]
    add_on = (spike_ind,)
    for b in bigger:
        add_on += (b*np.ones(int(spiketrain[b])-1, dtype=int),)
    spike_ind = np.concatenate(add_on)
    return np.sort(spike_ind)

    Converts a binned spike train into spike time indices (with duplicates)
    
    :param np.array spiketrain: the spike train to convert
    :returns: spike indices denoting spike times in units of time bins
    :rtype: np.array
    
Converts a binned spike train into spike time indices (with duplicates)
Converts a binned spike train into spike time indices ( with duplicates )
def binned_to_indices(spiketrain):
    spike_ind = spiketrain.nonzero()[0]
    bigger = np.where(spiketrain > 1)[0]
    add_on = (spike_ind,)
    for b in bigger:
        add_on += (b*np.ones(int(spiketrain[b])-1, dtype=int),)
    spike_ind = np.concatenate(add_on)
    return np.sort(spike_ind)
def binned_to_indices ( spiketrain ) : spike_ind = spiketrain . nonzero ( ) [ 0 ] bigger = np . where ( spiketrain > 1 ) [ 0 ] add_on = ( spike_ind , ) for b in bigger : add_on += ( b * np . ones ( int ( spiketrain [ b ] ) - 1 , dtype = int ) , ) spike_ind = np . concatenate ( add_on ) return np . sort ( spike_ind )
Converts a binned spike train into spike time indices (with duplicates)
Converts a binned spike train into spike time indices ( with duplicates )
"""
    Converts a binned spike train into spike time indices (with duplicates)
    
    :param np.array spiketrain: the spike train to convert
    :returns: spike indices denoting spike times in units of time bins
    :rtype: np.array
    """
spike indices denoting spike times in units of time bins
spike indices denoting spike times in units of time bins
np.array
spiketrain
the spike train to convert
the spike train to convert