You can do the in place variant using generator comprehension and writing the result in place in the original vector. The generator should run ahead of the write and should work fine.
It will also probably be significantly slower than just copying the vector.
It will also probably be significantly slower than just copying the vector.