Reputation: 23
I am importing arrays from a CSV file.
Example:
arr = ['foo1;foo2;foo3', 'baa1;baa2;baa3', 'bla1;bla2;bla3']
I now want to transform these semicolon seperated strings to a list of lists:
arr2 = [['foo1', 'foo2', 'foo3'], ['baa1', 'baa2', 'baa3'], ['bla1', 'bla2', 'bla3']]
How can I do this? I am struggling to find the right combination of split
, append
and delimiters to do this.
Upvotes: 0
Views: 218