0

I have a few arrays arranged and formatted as dataframe so that it can be output as csv in the end. I want to add another column of string at the end of the data for better understanding in the future.

A = [1,2,3,4,5,6,7,8,9,10]
B = [21,5,7,8,15,36,20,18,15,13]
W = [1,0,0,0,0,0,1,1,0,0]
Prediction = [0.23, 0.41 , 0.51, 0.1, 0.3, 0.7, 0.9, 0.1, 0.2, 0.8]

It should based on the values of the prediction to output a column of string. The conditions should be based on whether the values inside prediction is smaller than 0.5. So the output should look like this:

Class = ["Bad","Bad","Good","Bad","Bad","Good","Good","Bad","Bad","Good"]

0 Answers0