Cant replace 0 to nan in Python using Pandas

Cant replace 0 to nan in Python using Pandas

You can set inplace to True (default is False):

area.replace(0, np.nan, inplace=True)

See examples in docs.

You need to do:

area = area.replace(0, np.nan)

Cant replace 0 to nan in Python using Pandas

Leave a Reply

Your email address will not be published.