On Tue, Apr 26, 2016, at 11:38, subhabangal...@gmail.com wrote:
> I am trying to send you a revised example.
> list1=[u"('koteeswaram/BHPERSN engaged/NA ','class1')",
> u"('koteeswaram/BHPERSN is/NA ','class1')"] 
> 
> [('koteeswaram/BHPERSN engaged/NA ','class1'),
>  ('koteeswaram/BHPERSN is/NA  ','class1')]
> 
> I tried to make it as follows,
> list2=[]
> for i in list1:
>         a1=unicodedata.normalize('NFKD', i).encode('ascii','ignore')
>         a2=a1.replace('"',"")
>         list2.append(a2)

I think you're still a bit confused. The values don't actually contain
'"' (or 'u'), that's just an indicator that they're strings. You can't
turn a string into something else just by removing the quotes. Look at
the ast.literal_eval function as others have recommended.
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to