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
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
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
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---
> 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
-
[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.
> -
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