0

For say i have a data-frame which looks like this

enter image description here

Now i want to convert the Text values to lower case and also some regex operation. so i am writing a code like below.

for i in df['Text'].values():
    i.lower()
    re.sub(r"http\S+", " ",i)
    re.sub(re.sub('[^A-Za-z0-9]+', ' ',i)

But it seems my code is not working . Can someone help me understand where i'm doing it wrong.

sayan nandi
  • 83
  • 1
  • 6
  • 1
    `df['Text'] = df['Text'].str.lower().str.replace(..., regex=True)` – It_is_Chris Jun 23 '21 at 18:15
  • 2
    Please have a look at [How to make good pandas examples](https://stackoverflow.com/questions/20109391/how-to-make-good-reproducible-pandas-examples) and provide your sample data in the text of the question, not as an image or external link, to make a [mcve] – G. Anderson Jun 23 '21 at 18:16

0 Answers0