Im very new to python and trying to figure out how to graph out some data which can have missing data for any given date.
The data is number of jobs completed (y), their rating (secondary Y), and date (x).
The graph looks how id like however jobs dont get completed each day so there are days where there is no data and the line on the graph just stops.
Is there a way to have it automatically connect the dots on the graph?
import matplotlib.pyplot as plt
import pandas as pd
import database
df = pd.DataFrame(database.getTasks("Pete"), columns=['date', 'rating', 'jobs']).set_index('date')
fig, ax = plt.subplots()
ax3 = ax.twinx()
rspine = ax3.spines['right']
rspine.set_position(('axes', 1.15))
ax3.set_frame_on(True)
ax3.patch.set_visible(False)
df.jobs.plot(ax=ax, style='b-')
df.rating.plot(ax=ax, style='r-', secondary_y=True)
plt.show()
df.fillna(arguments)or drop the valuesdf.dropna(inplace=True). If there are no non-observation data, it will connect the dots.