Josh Josh - 1 year ago 127
Python Question

Keep finite entries only in Pandas

In Pandas, I can use

to drop any
entries. Is there anything similar in Pandas to drop non-finite (e.g.
) entries?

Answer Source

You can use:

with pd.option_context('mode.use_inf_as_null', True):
   df = df.dropna()
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download