From 1ce685e799bc32bc3d3cade4daa586e93b917d84 Mon Sep 17 00:00:00 2001 From: chris0765 Date: Fri, 30 Sep 2022 16:08:37 +0900 Subject: [PATCH] Change the NA value to fill with -1, not zero --- collection/aws/ec2_collector/join_data.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/collection/aws/ec2_collector/join_data.py b/collection/aws/ec2_collector/join_data.py index e22c846..ee9c893 100644 --- a/collection/aws/ec2_collector/join_data.py +++ b/collection/aws/ec2_collector/join_data.py @@ -21,11 +21,11 @@ def build_join_df(spot_price_df, ondemand_price_df, spotinfo_df, sps_df): join_df = pd.merge(join_df, spotinfo_df, how="outer") join_df['Savings'] = 100.0 - (join_df['SpotPrice'] * 100 / join_df['OndemandPrice']) - join_df['Savings'] = join_df['Savings'].fillna(0) - join_df['SPS'] = join_df['SPS'].fillna(0) - join_df['SpotPrice'] = join_df['SpotPrice'].fillna(0) - join_df['OndemandPrice'] = join_df['OndemandPrice'].fillna(0) - join_df['IF'] = join_df['IF'].fillna(0) + join_df['Savings'] = join_df['Savings'].fillna(-1) + join_df['SPS'] = join_df['SPS'].fillna(-1) + join_df['SpotPrice'] = join_df['SpotPrice'].fillna(-1) + join_df['OndemandPrice'] = join_df['OndemandPrice'].fillna(-1) + join_df['IF'] = join_df['IF'].fillna(-1) join_df['Savings'] = join_df['Savings'].astype('int') join_df['SPS'] = join_df['SPS'].astype('int')