[ 
https://issues.apache.org/jira/browse/SPARK-10973?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Reynold Xin resolved SPARK-10973.
---------------------------------
       Resolution: Fixed
    Fix Version/s: 1.5.2
                   1.4.2
                   1.3.2

> __gettitem__ method throws IndexError exception when we try to access index 
> after the last non-zero entry.
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: SPARK-10973
>                 URL: https://issues.apache.org/jira/browse/SPARK-10973
>             Project: Spark
>          Issue Type: Bug
>          Components: MLlib, PySpark
>    Affects Versions: 1.3.0, 1.4.0, 1.5.0, 1.6.0
>            Reporter: Maciej Szymkiewicz
>            Assignee: Maciej Szymkiewicz
>              Labels: backport-needed
>             Fix For: 1.3.2, 1.4.2, 1.5.2, 1.6.0
>
>
> \_\_gettitem\_\_ method throws IndexError exception when we try to access  
> index  after the last non-zero entry.
> {code}
> 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
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to