The result i am looking for is a 2D array (matrix) instead of 1D array
of tuples. That's when i read a file using genfromtxt, it generated a 1D
array of n tuples (like the example shown below); each tuple has one row
from the original file. The file contains multiple data types and so i used
genfromtxt to specify data types for each column.


In another way, i just want to convert a 1D array of tuples to 2D array
where each tuple is converted multiple columns. Here is an example: the
output from genfromtxt is

[(1, 2, 3), (‘a’, b’, ’c’), (‘12/12/2009’, ’2/4/2014’, ‘3/4/200’)]

I want this be converted to:

[[1,                         2,              3],

[‘a’,                        b’,           ’c’],

[‘12/12/2009’, ’2/4/2014’, ‘3/4/200’]]




Thanks again--EKE
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to