Assuming C as the input list, two approaches could be suggested to solve it.
Approach #1 : Using one level of list comprehension with np.fromstring -
np.array([np.fromstring(item[0], dtype=int, sep=' ').tolist() for item in C])
Approach #2 : Vectorized approach using padding with np.core.defchararray.add and then getting the separated numerals -
np.fromstring(np.core.defchararray.add(C," "),dtype=int,sep=" ").reshape(len(C),-1)
Sample runs -
In [82]: C = [['2 0'], ['0 1'], ['3 4']]
In [83]: np.array([np.fromstring(item[0], dtype=int, sep=' ').tolist() for item in C])
Out[83]:
array([[2, 0],
[0, 1],
[3, 4]])
In [84]: np.fromstring(np.core.defchararray.add(C, " "),dtype=int,sep=" ").reshape(len(C),-1)
Out[84]:
array([[2, 0],
[0, 1],
[3, 4]])
Benchmarking
Borrowing the benchmarking code from @Mike Müller's solution, here are the runtimes for the long_coords and very_long_coords cases -
In [78]: coordinates = [["2 0"], ["0 1"], ["3 4"]]
...: long_coords = coordinates * 1000
...: %timeit np.array([np.fromstring(i, dtype=int, sep=' ') for j in long_coords for i in j])
...: %timeit np.array([np.fromstring(item[0], dtype=int, sep=' ').tolist() for item in long_coords])
...: %timeit np.array([[int(x) for x in coordinate[0].split()] for coordinate in long_coords])
...: %timeit np.fromstring(np.core.defchararray.add(long_coords, " "), dtype=int,sep=" ").reshape(len(long_coords),-1)
...:
100 loops, best of 3: 7.27 ms per loop
100 loops, best of 3: 9.52 ms per loop
100 loops, best of 3: 6.84 ms per loop
100 loops, best of 3: 2.73 ms per loop
In [79]: coordinates = [["2 0"], ["0 1"], ["3 4"]]
...: very_long_coords = coordinates * 10000
...: %timeit np.array([np.fromstring(i, dtype=int, sep=' ') for j in very_long_coords for i in j])
...: %timeit np.array([np.fromstring(item[0], dtype=int, sep=' ').tolist() for item in very_long_coords])
...: %timeit np.array([[int(x) for x in coordinate[0].split()] for coordinate in very_long_coords])
...: %timeit np.fromstring(np.core.defchararray.add(very_long_coords, " "), dtype=int,sep=" ").reshape(len(very_long_coords),-1)
...:
10 loops, best of 3: 80.7 ms per loop
10 loops, best of 3: 103 ms per loop
10 loops, best of 3: 71 ms per loop
10 loops, best of 3: 27.2 ms per loop