python - count values that contain special characters

36

special = '[(_:/,#%\=@)]'                    # Define special characters
df['count'] = df['myvar'].str.count(special) # Count them

Comments

Submit
0 Comments