'How do I convert the elements of nested lists into separate lists?
Say I have a list of lists;
my_list = [['apple', 'banana', 'orange'], ['carrot', 'pumpkin', 'potato']]
Is there a way that I can convert each element in each separate list into its own list?
Output:
new_list = [[['apple'], ['banana'], ['orange']], [['carrot'], ['pumpkin'], ['potato']]]
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
