spark-instrumented-optimizer/python/pyspark/mllib/linalg
zero323 8e67882b90 [SPARK-10973] [ML] [PYTHON] __gettitem__ method throws IndexError exception when we…
__gettitem__ method throws IndexError exception when we try to access index after the last non-zero entry

    from pyspark.mllib.linalg import Vectors
    sv = Vectors.sparse(5, {1: 3})
    sv[0]
    ## 0.0
    sv[1]
    ## 3.0
    sv[2]
    ## Traceback (most recent call last):
    ##   File "<stdin>", line 1, in <module>
    ##   File "/python/pyspark/mllib/linalg/__init__.py", line 734, in __getitem__
    ##     row_ind = inds[insert_index]
    ## IndexError: index out of bounds

Author: zero323 <matthew.szymkiewicz@gmail.com>

Closes #9009 from zero323/sparse_vector_index_error.
2015-10-08 18:34:15 -07:00
..
__init__.py [SPARK-10973] [ML] [PYTHON] __gettitem__ method throws IndexError exception when we… 2015-10-08 18:34:15 -07:00
distributed.py [SPARK-6486] [MLLIB] [PYTHON] Add BlockMatrix to PySpark. 2015-08-05 07:40:50 -07:00