1

I am trying to replace '?' with "'" but the question mark still remains. I am using below code to replace

df['Indication'] = df['Indication'].replace('?', '’')

The resulting column is given below:

Hodgkin?s Lymphoma at high risk of relapse or progression post-ASCT

But the output I want is the following:

Hodgkin's Lymphoma at high risk of relapse or progression post-ASCT
3
  • "but it is not working and giving some unwanted result" what is the unwanted result Commented Jun 9, 2021 at 6:53
  • @cs95 they provided that in the question, but i can edit it for clarity Commented Jun 9, 2021 at 6:54
  • @cs95 Hodgkin’s Lymphoma at high risk of relapse or progression post-ASCT Commented Jun 9, 2021 at 8:09

1 Answer 1

1

Use .str.replace:

df["Indication"] = df["Indication"].str.replace("?", "'", regex=False)
print(df)

Prints:

                                          Indication
0  Hodgkin's Lymphoma at high risk of relapse or ...
Sign up to request clarification or add additional context in comments.

1 Comment

Hodgkin’s Lymphoma at high risk of relapse or progression post-ASCT

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.