cleaning a string in a dataframe column

Viewed 20

i have the following column :

enter image description here

i want to remove the link and and any unnecessary symbols i've tried this :

def clean(col) : 
col =  re.sub("http\S*\s", "", col)
return col
PalEng["Content"] = PalEng["Content"].apply(str)
PalEng["Content"] = PalEng["Content"].apply(clean)

it worked for some rows , but the majority didn't change

1 Answers

You can get rid of "https://"

yoursting.removeprefix("https://")
Related