I have a problem with NumPy dtypes. Basically I'm trying to create a table that looks like the following (and Then save it using rec2csv): name1 name2 name3. . Name1 # # # name2 # # # Name 2 # # # . The matrix (numerical array at the center), the first name tag is calculated before attempting to add. I have tried to use the following code: dt = dtype ({'names': tuple (blah), 'format': tuple (fmt)}) ReadArray = array (tuplelist , Dtype = dt) where tuplelist is a list of rows (i.e. the line [name1, #, #, # ...]), blah is a list of strings (i.e. name , blah = ['name1', 'name2', ...] ) and the list of fmt format, s (i.e. fmt = [str, float, float, ...] ). The error I am getting is the following: Traceback (the most recent call final): The file "lt; stdin & gt;", line 1, & Lt; In module & gt; The file "table_calc_try2.py", in line 152, in table_calc_try2 dt = dtype ({'names': tuple (blah), ...
Comments
Post a Comment