0

I have data which is of type <class 'numpy.ndarray'>, in each string there is an array with strings inside them.

['[ABC]' '["ABC"]' '["ABC" "Pasticultores del Desierto"]'
 '[UNIQUE Forestry and Land Use]' '[]' '[Urapi Sustainable Land Use]'
 '[CARANA]' '[AF]' '[AAF]' '[CATIE]' '["Moring" "CIRAD"]' '[Moringa]'
 '[12Tree Finance]' '["AF" "CIMA"]' '["Andes Amazon Fund"]'
 '[Kaeté_Investimentos]' '[Pomeroon]' '[FCCF]' '[12Tree Fund]' '[12Tree]'
 '[Symbiosis_Investimentos]' '[LLC]' '[AIDER]' '[WRI]' '[ISA]']

I am trying to convert them into an array with arrays of strings inside.

[["ABC"], ["ABC"], ["ABC" ,"Pasticultores del Desierto"],
 ["UNIQUE Forestry and Land Use"], [], ["Urapi Sustainable Land Use"],
 ["CARANA"], ["AF"], ["AAF"], ["CATIE"], ["Moring","CIRAD"] , ["Moringa"],
 ["12Tree Finance"], ["AF","CIMA"], ["Andes Amazon Fund"],
 ["Kaeté_Investimentos"] , ["Pomeroon"] , ["FCCF"] , ["12Tree Fund"] , ["12Tree"],
 ["Symbiosis_Investimentos"] , ["LLC"] , ["AIDER"] , ["WRI"] , ["ISA"]]
yudhiesh
  • 6,383
  • 3
  • 16
  • 49
  • https://stackoverflow.com/questions/1894269/how-to-convert-string-representation-of-list-to-a-list – MarcMush Nov 05 '20 at 14:50
  • The fact that it's an array doesn't help you. You have to transform each string with string methods. – hpaulj Nov 05 '20 at 15:45

0 Answers0