Trying to remove single quotes from around numbers. I'm working with third paty data that's not well typed.
lst = [ ('text','2','3','4'), ('text2','4','5','6') ]
y= [map(int,i) for i in zip(*lst)[1:]]
d = zip(*list)[0]
print d
c= zip(*y)
print c
dd = zip(d,c)
print dd
this is what the out is:
('text', 'text2')
[(2, 3, 4), (4, 5, 6)]
[('text', (2, 3, 4)), ('text2', (4, 5, 6))]
How Do I get:
dd = [ ('text',2,3,4), ('text2',4,5,6) ]
EDIT:
If list is sometimes this: [ ['text','2','3','4'], ['text2','4','5','6'] ], then what do i do? Another problem is integer as '3,400'.
New Lst example:
lst = [ ('text','2','3','4'), ('text2','4','5,000','6,500') ]
Need:
[ ('text',2,3,4), ('text2',4,5000,6500) ]
3,400'supposed to mean?3,3400or3.4?