Given a rather large dataframe, I am looking to preprocess the inputs by standardizing them using the sklearn preprocessing module.
However, this error shows up:
ValueError: could not convert string to float:
How do I go about removing ANY row containing a non-float/integer type of value from my pandas DataFrame?
Here's the type of dataframe I have.
In [1]: df = pd.DataFrame([[0.02, 0.32], [1 04, 2 64], [2 06, 4 96]], columns=['A', 'B'])
Out[2]:
A B
0 0.02 0.32
1 1 04 2 64
2 2 06 4 96
Here's what I want to achieve:
In [1]: df = pd.DataFrame([[1, 2], [1, a], [4, 6]], columns=['A', 'B'])
#eliminate the space as a decimal separator and use a dot.
Out[2]:
A B
0 0.02 0.32
1 1.04 2.64
2 2.06 4.96