Is there a way to skip plotting NaN and Inf values in python?
Say I have something like:
m1 m2 m3
4 5 2
3 2 3
4 3 4
2 5 0
4 3 8
3 4 0
2 3 4
and I want to plot m1
vs m2/m3
so there are cases I am dividing by zero, so when I go to plot it throws a ValueError: Axis limits cannot be NaN or Inf
What is the solution? Thank you.
(I am using dataframes in pandas where I go m4 = df['m2'] / df['m3']
and go to plot m1
vs m4
)
Please note: there are no inf or Nan Values in the dataframe itself, but they occur after manipulation.