PERF: Series.dropna with non-nan dtype blocks by sinhrks · Pull Request #11159 · pandas-dev/pandas (original) (raw)
Minor improvement when dropna actually does nothing. If OK for 0.17, I'll add a release note.
import numpy as np
import pandas as pd
s = pd.Series(np.random.randint(0, 1000, 50000000))
# before
%timeit s.dropna()
#1 loops, best of 3: 1.58 s per loop
# after
%timeit s.dropna()
#1 loops, best of 3: 568 ms per loop