Im trying to get a 10 x 8 array
using the code below with numpy
import numpy as np
columns = ["Port Wt", "Bench Wt", "Port Retn",
"Bench Retn", "Attrib", "Select", "Inter", "Total"]
a = np.ones([10,len(columns)],
dtype={"names":columns, "formats":["f8"]*len(columns)})
I'm new to numpy and I get unexpected behaviour - I'm getting a 10 x 8 x 8 grid
instead.
I've tried
a.dtype.names = columns
and get a ValueError: there are no fields defined
What am I doing wrong and how would I get a 10 x 8 grid as desired with the names?
Thanks