df = pd.DataFrame({'c1': 0, 'c2': np.random.random(100)})
x = 0.25
diff = df.c2.apply(lambda z: abs(x - z))
diff.sort()
inds = diff.index[:5]
return rows in a dataframe closest to a user-defined number