From 190c3e6c8796546aa5b9fee355e4b3ebc6d38361 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Thu, 23 Aug 2018 16:27:46 -0400 Subject: [PATCH] Fix pandas rolling calls in run_time graph This commit fixes the use of rolling_mean() and rolling_std() in the run_time graph command. These functions were removed from pandas a few releases ago and were replaced by the Rolling class. We updated the other commands already, but the run_time graph was missed. This commit corrects the oversight and uses the Rolling class to generate the rolling mean and std dev data. Change-Id: I4a2fd0256b05f468cdbbe67fb2573233f64d74d8 --- subunit2sql/analysis/run_time.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/subunit2sql/analysis/run_time.py b/subunit2sql/analysis/run_time.py index cc03c6f..3fadc9f 100644 --- a/subunit2sql/analysis/run_time.py +++ b/subunit2sql/analysis/run_time.py @@ -53,8 +53,9 @@ def generate_series(): if ts.count() == 0: print("No data available. Check your query and try again.") exit(-1) - mean = pd.rolling_mean(ts, 20) - rolling_std = pd.rolling_std(ts, 20) + roll = ts.rolling(window=20, center=False) + mean = roll.mean() + rolling_std = roll.std() plt.figure() if not CONF.title: plt.title(test.test_id)