如何将字符串中包含数组的numpy字符串数组转换为字符串数组?

时间:2020-11-05 14:45:09

标签: python arrays pandas numpy numpy-ndarray

我有<class 'numpy.ndarray'>类型的数据,每个字符串中都有一个包含字符串的数组。

['[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]']

我正在尝试将它们转换为内部包含字符串数组的数组。

[["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"]]

0 个答案:

没有答案