3
$\begingroup$

I am trying to clean the data. But I don't know how to remove a function from a column in data frame.enter image description here

At row number 473 it show column N has a function . How it should be filtered out ?

$\endgroup$
  • $\begingroup$ Could you add your code and specify which library you are using? $\endgroup$ – Archie May 21 '18 at 13:00
  • $\begingroup$ @Archie Its solved $\endgroup$ – Abhishek Priyankar May 22 '18 at 10:29
2
$\begingroup$

a generic way to convert pandas column to numeric dtype:

df['col_name'] = pd.to_numeric(df['col_name'], errors='coerce')

this will replace all values, that couldn't be converted to numeric values with NaN's (Not a Number).

PS you may want to analyze how and why do you have a reference to a lambda function in your cells. Fixing the source of that problem would be a more appropriate solution.

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.