I'd like to turn the following string into an array with 3 columns and multiple rows if possible in python. I'm attempting to turn the following into a workable numerical data set - using an array, and currently I'm unable to figure out how to turn it from a string --> array. I'm seeing that it's nearly in the format that I'd like it in. Is there a way to turn everything in between each apostrophe (ex. '-1,38,31857' as one row, and '-1,40,39304') as another row, and compile all of those into an array?
'-1,38,31857', '-1,40,39304', '1582871,64,445338', '-1,37,29632', '-1,1,82', '-1,18,3613', '-1,6,544', '-1,23,7025', '-1,34,20775', '1979527,23,6361', '-1,10,1330', '-1,17,3300', '-1,11,1426', '-1,8,853', '-1,24,7087', '-1,1,0', '-1,1,0', '198113,79,1927770', '-1,1,0', '1763114,1,42', '1803615,4,357', '-1,1,0', '-1,1,0', '-1,-1', '-1,-1', '-1,-1', '-1,-1', '-1,-1', '-1,-1', '-1,-1', '-1,-1', '-1,-1', '-1,-1', '-1,-1', '-1,-1', '-1,-1', '-1,-1', '-1,-1', '-1,-1', '-1,-1', '-1,-1', '-1,-1', '-1,-1', '-1,-1', '-1,-1', '-1,-1', '-1,-1', '-1,-1', '-1,-1', '-1,-1', '-1,-1', '-1,-1', '-1,-1', '-1,-1', '-1,-1', '-1,-1', '-1,-1', '-1,-1', '-1,-1', '-1,-1', '-1,-1', '-1,-1', '-1,-1', '-1,-1', '-1,-1', '-1,-1', '-1,-1', '-1,-1', '-1,-1', '-1,-1', '-1,-1', '-1,-1', '-1,-1', '-1,-1', '-1,-1', '-1,-1', '-1,-1', '-1,-1', '-1,-1'] ``` https://stackoverflow.com/questions/66095064/how-to-turn-a-string-with-numbers-into-an-array February 08, 2021 at 10:03AM
没有评论:
发表评论