I am applying a function on a pandas column, but I am getting an error on certain values. I am not sure what is causing the error so to fix the error I want to see that value where the error is raised.
For eg suppose I have a column in the dataframe which contains all numerical values in string format except one value.
DataFrame:
|col num|col random|
|:-:|:-:|
|'8'|0.2|
|'9'|0.9|
|'abcd'|0|
|'10'|1|
And I am applying int
function on that column. So it will raise the error on that exception.
df['col num'].apply(int)
And for debugging, I want to get "abcd".
Note the above scenario is just an example and I am not trying to convert any data type of a column;