To avoid interpolation of missing values when using pandas.plot()
, you can set the interpolate
parameter to False
. By default, this parameter is set to True
.
Here is an example code snippet that demonstrates how you can do this:
main.py291 chars12 lines
In this example, the df.plot()
method is used to create a line plot of the dataframe. The interpolate
parameter is set to False
to prevent pandas from interpolating missing values. The resulting plot will have gaps where the missing values are located.
gistlibby LogSnag