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:
parent
8d3faff9a4
commit
4db9a61471
@ -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)
|
numeric_dict, temp_dict = format_output_dicts(df, None)
|
||||||
return {'numeric': numeric_dict, 'data': temp_dict}
|
return {'numeric': numeric_dict, 'data': temp_dict}
|
||||||
numeric_df = df[df['status'] == 'success'].resample(
|
numeric_df = df[df['status'] == 'success'].resample(
|
||||||
base.resample_matrix[resample], how='mean')
|
base.resample_matrix[resample]).mean()
|
||||||
# Drop duplicate or invalid columns
|
# Drop duplicate or invalid columns
|
||||||
del(numeric_df['run_id'])
|
del(numeric_df['run_id'])
|
||||||
del(df['run_time'])
|
del(df['run_time'])
|
||||||
# Interpolate missing data for a smooth avg and std dev
|
# Interpolate missing data for a smooth avg and std dev
|
||||||
temp_numeric_df = numeric_df.interpolate(method='time', limit=20)
|
temp_numeric_df = numeric_df.interpolate(method='time', limit=20)
|
||||||
# Add rolling mean and std dev of run_time to dataframe
|
# Add rolling mean and std dev of run_time to dataframe
|
||||||
numeric_df['avg_run_time'] = pd.rolling_mean(temp_numeric_df['run_time'],
|
numeric_df['avg_run_time'] = temp_numeric_df['run_time'].rolling(
|
||||||
20)
|
window=20).mean()
|
||||||
numeric_df['stddev_run_time'] = pd.rolling_std(temp_numeric_df['run_time'],
|
numeric_df['stddev_run_time'] = temp_numeric_df['run_time'].rolling(
|
||||||
20)
|
window=20).std()
|
||||||
numeric_df = numeric_df.dropna(how='all')
|
numeric_df = numeric_df.dropna(how='all')
|
||||||
|
|
||||||
numeric_dict, temp_dict = format_output_dicts(df, numeric_df)
|
numeric_dict, temp_dict = format_output_dicts(df, numeric_df)
|
||||||
|
@ -10,7 +10,7 @@ SQLAlchemy<1.1.0,>=1.0.10 # MIT
|
|||||||
flask-jsonpify>=1.5.0 # MIT
|
flask-jsonpify>=1.5.0 # MIT
|
||||||
PyMySQL>=0.6.2 # MIT License
|
PyMySQL>=0.6.2 # MIT License
|
||||||
python-dateutil>=2.4.2 # BSD
|
python-dateutil>=2.4.2 # BSD
|
||||||
pandas>=0.17.1 # BSD
|
pandas>=0.18.0 # BSD
|
||||||
numpy>=1.7.0 # BSD
|
numpy>=1.7.0 # BSD
|
||||||
six>=1.9.0 # MIT
|
six>=1.9.0 # MIT
|
||||||
pytz>=2013.6 # MIT
|
pytz>=2013.6 # MIT
|
||||||
|
Loading…
Reference in New Issue
Block a user