Given a matrix with string and empty cells inside (name)
print(name)
[]
['Puchkin A.']
[]
['Kudryashova V.']
[]
How to convert this matrix into a list, approximately:
[[], ['Puchkin A.'], [], ['Kudryashova V.'], []]
You could use numpy's built in function matrix() and then use tolist()
Here's an example:
import numpy as np
matrix = [[],
['Puchkin A.'],
[],
['Kudryashova V.'],
[]]
print((np.matrix(matrix)).tolist())
[[], ['Puchkin A.'], [], ['Kudryashova V.'], []]