“Python Pandas Удалите пунктуацию” Ответ

Серия Pandas Удалить пунктуацию

# Define the function to remove the punctuation
def remove_punctuations(text):
    for punctuation in string.punctuation:
        text = text.replace(punctuation, '')
    return text
# Apply to the DF series
df['new_column'] = df['column'].apply(remove_punctuations)
Depressed Dotterel

Python Pandas Удалите пунктуацию

x = pd.DataFrame(dict(column1=["Lorum. ipsum.?"]))
x["column1"] = x["column1"].str.replace('[^\w\s]','')
Sulphix

Ответы похожие на “Python Pandas Удалите пунктуацию”

Вопросы похожие на “Python Pandas Удалите пунктуацию”

Больше похожих ответов на “Python Pandas Удалите пунктуацию” по Python

Смотреть популярные ответы по языку

Смотреть другие языки программирования