I have a numpy array
arr = np.array([
[1, (10, 20, 30, 40)],
[2, (10, 20, 30, 40)],
[5, (11, 22, 33, 44)]
])
I wonder if there's a way that I can get :
ans = [
[1, 10, 20, 30, 40],
[2, 10, 20, 30, 40],
[5, 11, 22, 33, 44]
]
using list comprehension in python.
I've tried:
ans = [list(row[1]).append(row[0]) for row in arr]
but got [None, None, None] as the output