<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def select_peaks(data, events, limit):
 """Check whether event satisfies amplitude limit. Parameters data : ndarray (dtype='float') vector with data events : ndarray (dtype='int') N x 2+ matrix with peak/trough in second position limit : float low and high limit for spindle duration Returns ------- ndarray (dtype='int') N x 2+ matrix with peak/trough in second position """

    selected = abs(data[events[:, 1]]) >= abs(limit)

    return events[selected, :]