%timeit df.apply(lambda row: 'high' if row['sales'] > 5000 else 'low', axis=1) %timeit np.where(df['sales'] > 5000, 'high', 'low')