This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Benchmarking pandas order vs algos.kth_smallest | |
''' | |
import pandas as pd | |
s = pd.Series(np.random.randint(100000,size=100000)) | |
def fast_order(x, n): | |
v = pd.algos.kth_smallest(x.values.astype(float),n) | |
return x[x<=v] |
NewerOlder