I am using KNeighborsClassifier to classify some values like this:
arr = classifier_3NN.predict(testData_df)
len(arr)
10960
I want to assign this array to a column in a DataFrame, I have checked & it is the same size:
len(df[df['events']=='NaN']['events'])
10960
When I do the following command the array values are not in the column as expected:
df[df['events']=='NaN']['events'] = arr
Can anyone see what I'm doing wrong?