def get_bySweep(self,feature="<STR_LIT>"):
self.ensureDetection()<EOL>bySweepTimes=[[]]*self.abf.sweeps<EOL>for sweep in range(self.abf.sweeps):<EOL><INDENT>sweepTimes=[]<EOL>for ap in self.APs:<EOL><INDENT>if ap["<STR_LIT>"]==sweep:<EOL><INDENT>sweepTimes.append(ap["<STR_LIT>"])<EOL><DEDENT><DEDENT>bySweepTimes[sweep]=sweepTimes<EOL><DEDENT>bySweepFreqs=[[]]*self.abf.sweeps<EOL>for i,times in enumerate(bySweepTimes):<EOL><INDENT>if len(times)<<NUM_LIT:2>:<EOL><INDENT>continue<EOL><DEDENT>diffs=np.array(times[<NUM_LIT:1>:])-np.array(times[:-<NUM_LIT:1>])<EOL>bySweepFreqs[i]=np.array(<NUM_LIT:1>/diffs).tolist()<EOL><DEDENT>if feature == "<STR_LIT>":<EOL><INDENT>return bySweepFreqs<EOL><DEDENT>elif feature == "<STR_LIT>":<EOL><INDENT>result=np.zeros(self.abf.sweeps) <EOL>for i,freqs in enumerate(bySweepFreqs):<EOL><INDENT>if len(freqs):<EOL><INDENT>result[i]=freqs[<NUM_LIT:0>]<EOL><DEDENT><DEDENT>return result<EOL><DEDENT>elif feature == "<STR_LIT>":<EOL><INDENT>return bySweepTimes<EOL><DEDENT>elif feature == "<STR_LIT:count>":<EOL><INDENT>result=np.zeros(self.abf.sweeps) <EOL>for i,times in enumerate(bySweepTimes):<EOL><INDENT>result[i]=len(bySweepTimes[i])<EOL><DEDENT>return result<EOL><DEDENT>elif feature == "<STR_LIT>":<EOL><INDENT>result=np.zeros(self.abf.sweeps) <EOL>for i,freqs in enumerate(bySweepFreqs):<EOL><INDENT>if len(freqs):<EOL><INDENT>result[i]=np.nanmean(freqs)<EOL><DEDENT><DEDENT>return result<EOL><DEDENT>elif feature == "<STR_LIT>":<EOL><INDENT>result=np.zeros(self.abf.sweeps) <EOL>for i,freqs in enumerate(bySweepFreqs):<EOL><INDENT>if len(freqs):<EOL><INDENT>result[i]=np.nanmedian(freqs)<EOL><DEDENT><DEDENT>return result<EOL><DEDENT>else:<EOL><INDENT>self.log.error("<STR_LIT>",feature)<EOL>return None<EOL><DEDENT>
returns AP info by sweep arranged as a list (by sweep).

feature:
    * "freqs" - list of instantaneous frequencies by sweep.
    * "firsts" - list of first instantaneous frequency by sweep.
    * "times" - list of times of each AP in the sweep.
    * "count" - numer of APs per sweep.
    * "average" - average instanteous frequency per sweep.
    * "median" - median instanteous frequency per sweep.