# Other Programming > Python >  Pandas: create a function to delete links

## Coreycoder

I have written a function using regex to delete links from the oldText column (containing more than 1000 rows) in a pandas DataFrame, however, it is not working correctly. Here is my code:



```
def remove_links(text):
    text = re.sub(r'http\S+', '', text) 
    text = text.strip('[link]') 

    return text

df['newText'] = df['oldText'].apply(remove_links)
```

There is no error in my code, but it is not giving any output.

----------


## 2kaud

> There is no error in my code, but it is not giving any output.


That statement doesn't seem correct. Either the code is correct and the output is as expected or there's an issue somewhere with the code...

----------

