Re: [Tutor] Add rownumber to list of .arff files

2011-01-16 Thread Daan Raemdonck
Sincerely, Daan -Original Message- From: David Hutto [mailto:smokefl...@gmail.com] Sent: zaterdag 15 januari 2011 22:50 To: Daan Raemdonck Cc: tutor@python.org Subject: Re: [Tutor] Add rownumber to list of .arff files >>> filename = ['file1','file2','

Re: [Tutor] Add rownumber to list of .arff files

2011-01-15 Thread David Hutto
>>> filename = ['file1','file2','file3'] >>> fileprefix = 'TRE_' >>> for item in filename: print('%s%s'%(fileprefix,item)) ... TRE_file1 TRE_file2 TRE_file3 or with list comp >>> combined = [('%s%s'%(fileprefix,item)) for item in filename] >>> combined ['TRE_file1', 'TRE_file2', 'TRE_file3'] >>>

Re: [Tutor] Add rownumber to list of .arff files

2011-01-15 Thread David Hutto
On Sat, Jan 15, 2011 at 12:02 PM, Daan Raemdonck wrote: > Dear all, > > > > I am reaching out to you because I have a small issue I need to deal with, > yet I feel that it requires pretty advanced coding to solve. > > I have a whole lot of .arff files that would simply need a case number added > t

[Tutor] Add rownumber to list of .arff files

2011-01-15 Thread Daan Raemdonck
Dear all, I am reaching out to you because I have a small issue I need to deal with, yet I feel that it requires pretty advanced coding to solve. I have a whole lot of .arff files that would simply need a case number added to every line of data. I've been able to do this for 1 file, but now I