-
-
Save timmapuramreddy/265dd0eccbf61b0e4f0aee464260334a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def remove_col_str(df): | |
| # remove a portion of string in a dataframe column - col_1 | |
| df['col_1'].replace('\n', '', regex=True, inplace=True) | |
| # remove all the characters after &# (including &#) for column - col_1 | |
| df['col_1'].replace(' &#.*', '', regex=True, inplace=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment