Let us see how to remove special characters like #, @, &, etc. from column names in the pandas data frame. Here we will use replace function for removing special character.
Example 1: remove a special character from column names
Here, we have successfully remove a special character from the column names. Now we will use a list with replace function for removing multiple special characters from our column names.
Example 2: remove multiple special characters from the pandas data frame
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course