Contest Getting ValueError when using FIT_TRANSFORM

Discussion in 'Big Data and Analytics' started by _49336, Jan 13, 2020.

  1. _49336

    _49336 Member
    Alumni

    Joined:
    Nov 23, 2018
    Messages:
    3
    Likes Received:
    0
    Hi - I have loaded clevelanda.csv file into python. Copied columns 0 to 4 into an array X. copied column 5 into new array Y. When doing the rescale of the data by using FIT_TRANSFORM function it is giving me following error "valueerror: the truth value of an array with more than one element is ambiguous". Please help me I have pasted the code I have done.

    clevelanda = pd.read_csv('clevelanda.csv')

    array_clevelanda = clevelanda.values

    C_X=array_clevelanda[:,0:5]

    C_Y=array_clevelanda[:,5]

    C_scalarx= MinMaxScaler(C_X)

    C_rescaleX =C_scalarx.fit_transform(C_X)

    Traceback (most recent call last):
    File "<pyshell#172>", line 1, in <module>
    C_rescaleX =C_scalarx.fit_transform(C_X)
    File "C:\ORMS\Portable_python_3.7\Portable Python 3.7.0 x64\App\Python\lib\site-packages\sklearn\base.py", line 571, in fit_transform
    return self.fit(X, **fit_params).transform(X)
    File "C:\ORMS\Portable_python_3.7\Portable Python 3.7.0 x64\App\Python\lib\site-packages\sklearn\preprocessing\_data.py", line 339, in fit
    return self.partial_fit(X, y)
    File "C:\ORMS\Portable_python_3.7\Portable Python 3.7.0 x64\App\Python\lib\site-packages\sklearn\preprocessing\_data.py", line 363, in partial_fit
    if feature_range[0] >= feature_range[1]:
    ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

    Thanks in advance.
     
    #1

Share This Page