GitHub user zero323 opened a pull request: https://github.com/apache/spark/pull/9098
[SPARK-11084][ML][PYTHON] Check if index can contain non-zero value before binary search At this moment `SparseVector.__getitem__` executes `np.searchsorted` first and checks if result is in an expected range after that. It is possible to check if index can contain non-zero value before executing `np.searchsorted`. You can merge this pull request into a Git repository by running: $ git pull https://github.com/zero323/spark sparse_vector_getitem_improved Alternatively you can review and apply these changes as the patch at: https://github.com/apache/spark/pull/9098.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #9098 ---- commit 7f1e455fff7f68508db39a5186d6894a9857b54c Author: zero323 <matthew.szymkiew...@gmail.com> Date: 2015-10-13T11:59:42Z Check if index can contain non-zero value before binary search ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org