I'm trying to converting string lists to integers but it always fails with the same error no matter which method I use to convert.
The error is TypeError: int() argument must be a string or a number, not 'list'.
Here's the code that I've tried:
#list2 = [int(s) for s in list1]
#list2 = map(int, list1)
try:
for i in list1 :
list2.append(int(list1));
except :
print "The int conversion failed"
print list2
The initial list, list1, just contains some string numbers:
[['4183'], ['4034'], ['3342'], ['3482'], ['8567'], ['1052'], ['8135'], ['5561'], ['517'],
['1218'], ['8877']]
How can get I avoid the list input error?