I want to copy contents of a few fields in a record array into a ndarray (both type float64). I know how to do this when the recarray data has a single value in each field:
my_ndarray[:,0]=my_recarray['X'] #(for field 'X')
Now I have a recarray with a list of 5 floats in each field, and I only want to copy the first element of each list. When I use the above with the new recarray (and list), I get this error:
ValueError: could not broadcast input array from shape (92,5) into shape (92)
That makes total sense (in hindsight).
I thought I could get just the first element of each with this:
my_ndarray[:,0]=my_recarray['X'][0] #(for field 'X')
I get this error:
ValueError: could not broadcast input array from shape (5) into shape (92)
I sorta understand...numpy is only taking the first row (5 elements) and trying to broadcast into a 92 element column.
So....now I'm wondering how to get the first element of each list down the 92 element column, Scratchin my head.... Thanks in advance for advice.