Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Sparse get dummies perf #21997
Previously, we did a scalar
This replaces that check with a vectorized
Running the ASV now. In the meantime, here's a simple timeit on the same problem
# HEAD In : %timeit pd.get_dummies(s, sparse=True) 561 ms ± 4.96 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) # Master In : %timeit pd.get_dummies(s, sparse=True) 2.18 s ± 273 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
Here's the ASV (only a 3x speedup).