I have the following sample object:
list_sample = [['N', [], None], ['B:maj', [3, 6, 11], 11], ['C#:maj', [1, 5, 8], 1], ['Bb:min', [1, 5, 10], 10], ['Eb:min/b3', [3, 6, 6, 10], 6], ['B:maj', [3, 6, 11], 11], ['C#:maj', [1, 5, 8], 1], ['F#:maj', [1, 6, 10], 6], ['F#:maj', [1, 6, 10], 6], ['B:maj', [3, 6, 11], 11], ['C#:maj', [1, 5, 8], 1], ['Bb:min', [1, 5, 10], 10], ['Eb:min', [3, 6, 10], 3], ['B:maj', [3, 6, 11], 11]]
I would like to transfer this list into a ndarray, so I tried this method suggested in this postDebugging Numpy VisibleDeprecationWarning (ndarray from ragged nested sequences):
np.array(formatted_chords,dtype = object)
But it gives me undesired result like this:
[['N' list([]) None]
['B:maj' list([3, 6, 11]) 11]
['C#:maj' list([1, 5, 8]) 1]
['Bb:min' list([1, 5, 10]) 10]
['Eb:min/b3' list([3, 6, 6, 10]) 6]
['B:maj' list([3, 6, 11]) 11]]
My target output would a ndarray which looks like this:
[['N',[],None]
['B:maj',[3, 6, 11]),11]
['C#:maj',[1, 5, 8]),1]
['Bb:min',[1, 5, 10]),10]
['Eb:min/b3',[3, 6, 6, 10],6]
['B:maj',[3, 6, 11],11]]
Can anybody shares how to do this transformation?