Hi I am trying to use argmax function on a numpy array but it shows an error.
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-25-914c12a3a737> in <module>()
5 # TODO - Check for data issues
6 # Hint: You can convert from one-hot to integers with argmax
----> 7 train_df1 = train_df1.argmax(axis = 1)
8
9 # Initialise
AttributeError: 'function' object has no attribute 'argmax'
code:
train_df1
<bound method DataFrame.to_numpy of MEL NV BCC AKIEC BKL DF VASC
0 0.0 1.0 0.0 0.0 0.0 0.0 0.0
1 0.0 1.0 0.0 0.0 0.0 0.0 0.0
2 0.0 1.0 0.0 0.0 0.0 0.0 0.0
3 0.0 1.0 0.0 0.0 0.0 0.0 0.0
4 1.0 0.0 0.0 0.0 0.0 0.0 0.0
.. ... ... ... ... ... ... ...
194 0.0 1.0 0.0 0.0 0.0 0.0 0.0
195 0.0 1.0 0.0 0.0 0.0 0.0 0.0
196 0.0 1.0 0.0 0.0 0.0 0.0 0.0
197 0.0 1.0 0.0 0.0 0.0 0.0 0.0
198 0.0 0.0 1.0 0.0 0.0 0.0 0.0
[199 rows x 7 columns]>
train_df1 = train_df1.argmax(axis = 1)
does anyone understand why I am getting this?
Thanks