quinngroup / dr1dl-pyspark

Dictionary Learning in PySpark
Apache License 2.0
1 stars 1 forks source link

copying a vector to vector #10

Closed MOJTABAFA closed 8 years ago

MOJTABAFA commented 8 years ago

as I Know there is three way to copy a vector to another one in python:

1.v1=v2 2.v1[:]=v2 (it seems its faster than 1) 3.numpy.copyto(v2, v1, casting='same_kind', where=None)

I think the 3rd one would be the best but unfortunately It doent work , I mean afetr testing still the value of v2 is the initial value and not the copied one(python 3.5). should I use the 2nd method ?

magsol commented 8 years ago

I am not sure what you're trying to accomplish here. NumPy has a copy function: http://docs.scipy.org/doc/numpy/reference/generated/numpy.copy.html

MOJTABAFA commented 8 years ago

Thanks , It was my mistake , now it's solved : numpy.copyto works properly

MOJTABAFA commented 8 years ago

So I'll close this issue