Re: Scan CSV file and saving it into an array

2013-04-24 Thread Oscar Benjamin
On 25 April 2013 00:01, Ana Dionísio wrote: > Hello! > > I have this script that scans a csv file and if the value in the first column > == 200 it saves that row into an array. > > The problem is, I need to save that row and the next 10 rows in that same > array. What can I add to the script so

Re: Scan CSV file and saving it into an array

2013-04-24 Thread Dave Angel
On 04/24/2013 07:01 PM, Ana Dionísio wrote: Hello! I have this script that scans a csv file and if the value in the first column == 200 it saves that row into an array. No it doesn't. It creates a list, then overwrites it with a numpy array, then overwrites that with a list of strings repres

Re: Scan CSV file and saving it into an array

2013-04-24 Thread Dave Angel
On 04/24/2013 07:21 PM, Rhodri James wrote: On Thu, 25 Apr 2013 00:01:01 +0100, Ana Dionísio wrote: Odd that this subject should have come up so many times in various guises in the last week or two. Not that odd. In a larger classroom I'd expect several of the students to have enough

Re: Scan CSV file and saving it into an array

2013-04-24 Thread Rhodri James
On Thu, 25 Apr 2013 00:01:01 +0100, Ana Dionísio wrote: I tried to do for row in len(10): but I get an error. Please remember to tell us what error, with the traceback, so that we can make fun of you for not reading it :-) In this case it's pretty obvious; Python will complain that you

Scan CSV file and saving it into an array

2013-04-24 Thread Ana Dionísio
Hello! I have this script that scans a csv file and if the value in the first column == 200 it saves that row into an array. The problem is, I need to save that row and the next 10 rows in that same array. What can I add to the script so it does that? I tried to do for row in len(10): but I ge