You need to string.punctuation over the string in the data frame, not over string.punctuation . You also need to create a string using .join() .
df['cleaned'] = df['old'].apply(lambda x:''.join([i for i in x if i not in string.punctuation]))
When lambda expressions become long, it may be more readable to write out the function definition separately, for example. (thanks @AndyHayden for optimization tips):
def remove_punctuation(s): s = ''.join([i for i in s if i not in frozenset(string.punctuation)]) return s df['cleaned'] = df['old'].apply(remove_punctuation)
source share