[Numpy-discussion] Create numpy array from a list error

2009-09-23 Thread Dave Wood
Hi all, I've got a fairly large (but not huge, 58mb) tab seperated text file, with approximately 200 columns and 56k rows of numbers and strings. Here's a snippet of my code to create a numpy matrix from the data file... data = map(lambda x : x.strip().split('\t'), sys.stdin.readlines())

Re: [Numpy-discussion] Numpy 2D array from a list error

2009-09-23 Thread Dave Wood
If the text file has 'numbers and strings' how is numpy meant to know what dtype to use? Please try genfromtxt especially if columns contain both numbers and strings. Well, I suppose they are all considered to be strings here. I haven't tried to convert the numbers to floats yet. What happens

Re: [Numpy-discussion] Numpy 2D array from a list error

2009-09-23 Thread Dave Wood
still had the same problem. On 9/23/09, Christopher Barker chris.bar...@noaa.gov wrote: Dave Wood wrote: Well, I suppose they are all considered to be strings here. I haven't tried to convert the numbers to floats yet. This could be an issue. For strings, numpy creates an array of strings

Re: [Numpy-discussion] Numpy 2D array from a list error

2009-09-23 Thread Dave Wood
for all the emails. Dave On 9/23/09, Dave Wood davejw...@gmail.com wrote: Appologies for the multiple posts, people. My posting to the forum was pending for a long time, so I deleted it and tried emailing directly. I didn't think they'd all be sent out. Gokan, thanks for the reply, I hope you