如何对所有数据进行清理?

img


如图,想要将所有数据去除‘:’后面的内容(包括:)。
即如
前:1111:22
后:1111


df=df.replace(r':.*','',regex=True)

s=s.split(':')[0] if s else s