0

I have a dataframe and some of them are empty. I want to make it a None string so I can parse it easier than a NaN value.

1
  • 1
    None a python object, NaN is a float type which is better suited to represent missing data. Can you explain what you're trying to do? Commented Mar 5, 2019 at 19:46

1 Answer 1

1
df = df.replace(np.nan, 'None', regex=True)

Use the code above.

Sign up to request clarification or add additional context in comments.

1 Comment

regex=True this is not going to work especially since you are not replacing strings (np.nan is not a string)

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.