I have a problem related to coding problem in python (IPython notebook). Since such problems are very common and simple, but I still can not fix it.
I have a CSV file, since you can see that we have many characters '\ xa0' and the other '\ n' in this file.
I used
with io.open(train_fname) as f:
for line in f:
line = line.encode("ascii", "replace")
But it does not work, I always get the following output.
Imagine that you can say that you know what sanctions, no eternal rumors about IEAA rules, no longer hide \ xa0under \ xa0 the pretense of friendly nuclear energy. \ xa0 You have 2 days; \ Xa0i.e. \ xa0let in inspectors, stop killing civilians.
I tried other methods like
line.replace(u"\xa0", " ")
, , CSV , .
windows-1252, utf-8 , \xa0 - CSV .
\ xa0
CSV ? python? , replace, ? \Xa0 , ? , utf-8, ascii ?
, , , . , , .
!
`