Fix pandas functions warnings

This commit fixes pandas functions warnings. Some of pandas functions such as
rolling_mean(), resample(how=xx) are deprecated from v0.18.0.

Change-Id: I1465e50821af2aaa77d5458205469c4eec1dab58
Closes-Bug: #1580447
This commit is contained in:
Masayuki Igawa 2016-05-11 15:06:20 +09:00
parent 8d3faff9a4
commit 4db9a61471
2 changed files with 6 additions and 6 deletions

View File

@ -76,17 +76,17 @@ def convert_test_runs_list_to_time_series_dict(test_runs_list, resample):
numeric_dict, temp_dict = format_output_dicts(df, None)
return {'numeric': numeric_dict, 'data': temp_dict}
numeric_df = df[df['status'] == 'success'].resample(
base.resample_matrix[resample], how='mean')
base.resample_matrix[resample]).mean()
# Drop duplicate or invalid columns
del(numeric_df['run_id'])
del(df['run_time'])
# Interpolate missing data for a smooth avg and std dev
temp_numeric_df = numeric_df.interpolate(method='time', limit=20)
# Add rolling mean and std dev of run_time to dataframe
numeric_df['avg_run_time'] = pd.rolling_mean(temp_numeric_df['run_time'],
20)
numeric_df['stddev_run_time'] = pd.rolling_std(temp_numeric_df['run_time'],
20)
numeric_df['avg_run_time'] = temp_numeric_df['run_time'].rolling(
window=20).mean()
numeric_df['stddev_run_time'] = temp_numeric_df['run_time'].rolling(
window=20).std()
numeric_df = numeric_df.dropna(how='all')
numeric_dict, temp_dict = format_output_dicts(df, numeric_df)

View File

@ -10,7 +10,7 @@ SQLAlchemy<1.1.0,>=1.0.10 # MIT
flask-jsonpify>=1.5.0 # MIT
PyMySQL>=0.6.2 # MIT License
python-dateutil>=2.4.2 # BSD
pandas>=0.17.1 # BSD
pandas>=0.18.0 # BSD
numpy>=1.7.0 # BSD
six>=1.9.0 # MIT
pytz>=2013.6 # MIT