0

I have an array correctClassifierLabels with [ 1. 1. -1. -1.] and I need to turn it into [[ 1.] [ 1.][ 1.][ 1.]] I have tried

correctClassifierLabels = correctClassifierLabels[:,0:1]

and

zip(*correctClassifierLabels)

and

transpose(correctClassifierLabels)

and none of them worked for me

Peter
  • 71
  • 6
  • It is hard to tell from your example (some negatives disappear) but I think you're just looking for `correctClassifierLabels[:, np.newaxis]`, inserting another axis. – miradulo Apr 16 '18 at 01:44
  • what is np supposed to represent here? I am getting that I am supposed to define it – Peter Apr 16 '18 at 01:46
  • NumPy, the Python library. Are you following some IPython notebook using Scikit, or are you doing this yourself with pure Python? – miradulo Apr 16 '18 at 01:47
  • just pure python – Peter Apr 16 '18 at 01:48

0 Answers0