Is there a vectorized way to copy elements from a pandas Series to a python built-in array? For example:
from array import arrayimport pandas as pds = pd.Series(range(0, 10, 2)); s += 0.1a = array('d', [0.0]*10)# I am looking for a vectorized equivalent of the below line:for n,x in enumerate(s): a[n] = x
In my case, the array is given as a memory buffer to an external code, which saves the array address and only re-reads array values upon each call. So, I cannot recreate the array and need to only replace its values as quickly as possible.
Thank you very much for your help!