
我写了这段代码,但它并没有给我正确的答案。请帮帮我。
for text in hiv2['Number of deaths due to HIV/AIDS']:
a=text.replace(' ','')
b=a.split('[')
hiv2['Number of deaths due to HIV/AIDS']=b[0]发布于 2020-12-04 14:22:55
使用.str.replace
df['col_name'] = df['col_name'].str.replace(r"\[.*\]","")https://stackoverflow.com/questions/65145215
复制相似问题