You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@spark.apache.org by pseudo oduesp <ps...@gmail.com> on 2016/06/03 13:07:27 UTC

np.unique and collect

Hi ,
why np.unique  return list instead of list in this function ?

def unique_item_df(df,list_var):

    l = df.select(list_var).distinct().collect()
    return np.unique(l)


df it s data frmae and list it lits of variables .

(pyspark) code
thanks
.

Re: np.unique and collect

Posted by Ted Yu <yu...@gmail.com>.
Where is np defined ?

Thanks

On Fri, Jun 3, 2016 at 6:07 AM, pseudo oduesp <ps...@gmail.com> wrote:

> Hi ,
> why np.unique  return list instead of list in this function ?
>
> def unique_item_df(df,list_var):
>
>     l = df.select(list_var).distinct().collect()
>     return np.unique(l)
>
>
> df it s data frmae and list it lits of variables .
>
> (pyspark) code
> thanks
> .
>