Re: csv into multiple columns using split function using python

2016-11-30 Thread Peter Otten
handa...@gmail.com wrote: > I am trying to split a specific column of csv into multiple column and > then appending the split values at the end of each row. > > `enter code here` > > import csv > fOpen1=open('Meta_D1.txt') > > reader=csv.reader(fO

Re: csv into multiple columns using split function using python

2016-11-29 Thread woooee
Add some print statements to see what is happening, especially after the for elem in mylist1: statement -- https://mail.python.org/mailman/listinfo/python-list

csv into multiple columns using split function using python

2016-11-29 Thread handar94
I am trying to split a specific column of csv into multiple column and then appending the split values at the end of each row. `enter code here` import csv fOpen1=open('Meta_D1.txt') reader=csv.reader(fOpen1) mylist=[elem[1].split(',') for elem in

Re: using split function

2006-11-07 Thread [EMAIL PROTECTED]
Thanks a lot, I am done with that part. But now I am facing another problem. I am using the code given below where A is a matrix and row is a sequence. But it gives following error: error-- A[a,:]=row ValueError: setting an array element with a sequence. --code---

Re: using split function

2006-11-06 Thread Gabriel Genellina
> I have to write a code in python to read a matrix from a text file and > for that i am using following code. But it gives an error saying > "NameError: name 'split' is not defined". Can anyone help me with this. A few hints: - don't use "file" as a name - it shadows the builtin "file" type -

Re: using split function

2006-11-06 Thread ina
[EMAIL PROTECTED] wrote: > Hi, > > I have to write a code in python to read a matrix from a text file and > for that i am using following code. But it gives an error saying > "NameError: name 'split' is not defined". Can anyone help me with this. > -

using split function

2006-11-06 Thread [EMAIL PROTECTED]
Hi, I have to write a code in python to read a matrix from a text file and for that i am using following code. But it gives an error saying "NameError: name 'split' is not defined". Can anyone help me with this. - #!/usr/bin/python import numpy file