When I run my Python code I get this error:
df = pd.DataFrame(desm)
scaler = StandardScaler()
scaler.fit(df)
ValueError Traceback (most recent call last)
<ipython-input-32-266a989a8af0> in <module>()
1 scaler = StandardScaler()
----> 2 scaler.fit(df)
C:\Users\VILLAFAÑE\Anaconda3\lib\site-packages\sklearn\preprocessing\data.py in fit(self, X, y)
555 # Reset internal state before fitting
556 self._reset()
--> 557 return self.partial_fit(X, y)
558
559 def partial_fit(self, X, y=None):
C:\Users\VILLAFAÑE\Anaconda3\lib\site-packages\sklearn\preprocessing\data.py in partial_fit(self, X, y)
578 X = check_array(X, accept_sparse=('csr', 'csc'), copy=self.copy,
579 ensure_2d=False, warn_on_dtype=True,
--> 580 estimator=self, dtype=FLOAT_DTYPES)
581
582 if X.ndim == 1:
C:\Users\VILLAFAÑE\Anaconda3\lib\site-packages\sklearn\utils\validation.py in check_array(array, accept_sparse, dtype, order, copy, force_all_finite, ensure_2d, allow_nd, ensure_min_samples, ensure_min_features, warn_on_dtype, estimator)
371 force_all_finite)
372 else:
--> 373 array = np.array(array, dtype=dtype, order=order, copy=copy)
374
375 if ensure_2d:
ValueError: could not convert string to float: 'PMP'
My Python code was:
import pandas as pd
desm = pd.read_csv("G:/BASES DE DATOS/desm4.csv")
I know that is something with the csv format, but I don't know how to solve it. Please help! Here is the link to the csv file, for more information
https://drive.google.com/file/d/0B7tO-O0lx79FSnR0cVA3MDhrTG8/view?usp=sharing