Changeset 0484dc1 for python/aubio
- Timestamp:
- Mar 1, 2006, 4:15:54 AM (19 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
- Children:
- 300adc3
- Parents:
- dcc8d90
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/aubio/median.py
rdcc8d90 r0484dc1 28 28 29 29 def short_find(a, rank): 30 a.sort() 31 return a[rank - 1] 30 """ find the rank-th value in sorted a """ 31 # copy to b before sorting 32 b = a[:] 33 b.sort() 34 return b[rank - 1] 32 35 33 # Find the rank'th-smallest value in a, in worst-case linear time.34 36 def percental(a, rank): 37 """ Find the rank'th-smallest value in a, in worst-case linear time. """ 35 38 n = len(a) 36 39 assert 1 <= rank <= n
Note: See TracChangeset
for help on using the changeset viewer.