我有一个数据集,格式为dataframe,并且其中包含方括号,我需要将数据中的方括号去除。请问应该如何处理?
From TO
[wrestle] engage in a wrestling match
[write] communicate or express by writing
[write] publish
[spell] write
[compose] write music
预期输出为:
From TO
wrestle engage in a wrestling match
write communicate or express by writing
write publish
spell write
df['From'] = df['From'].str.strip('[]')
应用于整个数据框,而不是逐列单独执行? - 1muflon1