Answers for "number of special characters in a string python"

3

special characters list in python

#this is the speical char list
symbols = {'~', ':', "'", '+', '[', '\', '@', '^', '{', '%', '(', '-', '"', '*', '|', ',', '&', '<', '`', '}', '.', '_', '=', ']', '!', '>', ';', '?', '#', '$', ')', '/'}
print(symbols)
Posted by: Guest on June-26-2021
1

python - count values that contain special characters

special = '[(_:/,#%=@)]'                    # Define special characters
df['count'] = df['myvar'].str.count(special) # Count them
Posted by: Guest on July-02-2020

Code answers related to "number of special characters in a string python"

Python Answers by Framework

Browse Popular Code Answers by Language