I am just getting started in Python and Machine Learning and have encountered an issue which I haven't been able to fix myself or with any other online resource. I am trying to scale a column in a pandas dataframe using a lambda function in the following way:
X['col1'] = X['col1'].apply(lambda x: (x - x.min()) / (x.max() - x.min()))
and get the following error message:
'float' object has no attribute 'min'
I have tried to convert the data type into integer and the following error is returned:
'int' object has no attribute 'min'
I believe I am getting something pretty basic wrong, hope anyone can point me in the right direction.