Skip to content
Snippets Groups Projects
Commit b39fb73c authored by Coda Phillips's avatar Coda Phillips
Browse files

Plot outliers based on 95 percentile

parent c0b76a48
No related branches found
No related tags found
No related merge requests found
......@@ -33,7 +33,7 @@ def qc_day(qc_path):
frame = frame.combine_first(qc_frame)
frame = frame.query('missingDataFlag == 0')
qc_frame_sum = qc_frame.sum(axis=0).to_string()
qc_frame_sum = (qc_frame > .95).sum(axis=0).to_string()
plots = []
......@@ -69,10 +69,10 @@ def plot_variable_qc(frame, loc, filename=None):
return mpld3.fig_to_html(fig)
def plot_outliers(frame, qc_mask, loc):
if (~np.isnan(qc_mask) & qc_mask > 0).any():
frame.ix[(np.isnan(qc_mask) | (qc_mask == 0)) & (frame['qc_percent'] == 0), loc].plot(style='b.')
frame.ix[(np.isnan(qc_mask) | (qc_mask == 0)) & (frame['qc_percent'] > 0), loc].plot(style='k.', alpha=.2)
frame.ix[~np.isnan(qc_mask) & (qc_mask > 0) & (frame['qc_percent'] > 0), loc].plot(style='r.')
if (~np.isnan(qc_mask) & qc_mask > .95).any():
frame.ix[(np.isnan(qc_mask) | (qc_mask < .95)) & (frame['qc_percent'] < .95), loc].plot(style='b.')
frame.ix[(np.isnan(qc_mask) | (qc_mask < .95)) & (frame['qc_percent'] > .95), loc].plot(style='k.', alpha=.2)
frame.ix[~np.isnan(qc_mask) & (qc_mask > .95) & (frame['qc_percent'] > .95), loc].plot(style='r.')
plt.xlabel('Time')
plt.title(loc)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment