Skip to content
Advertisement

Remove characters from column

I am trying to remove “0” and “:” from a column in a dataframe. The code I use is,

JavaScript

Output:

enter image description here

The result does not remove “0” and “:” How can I go about this?

Advertisement

Answer

You’re missing to assignment of the replacement back to the original column:

JavaScript

Though you can carry out this operation with only one application of replace:

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement