'How convert string to sequence 0 an 1 with comma in Python

I have a problem with adding a parameter to a 2d array. I want to add this value without string representation, do you have any idea how to do it? Thank you for your response.

CORRECT VERSION --
Verdict = '1,-1,1,1,1,1,1,1,1,-1,-1,1,1,1,1,1,1,-1,1,-1,1,1,-1,3,180,46,-1'

value = forest.predict([[1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, 1, 1, 1, 1, 1, -1, 1, -1, 1, 1, -1, 3, 180, 46]])

Here my example, I want to add "Verdict" as a paremeter to "value":

Verdict = '1,-1,1,1,1,1,1,1,1,-1,-1,1,1,1,1,1,1,-1,1,-1,1,1,-1,3,180,46,-1'
value = forest.predict([[Verdict]])

ERROR:

Blockquote ValueError: could not convert string to float: '1,-1,1,1,1,1,1,1,1,-1,-1,1,1,1,1,1,1,-1,1,-1,1,1,-1,3,180,46,-1'



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source