Skip to content

Commit

Permalink
Change the NA value to fill with -1, not zero
Browse files Browse the repository at this point in the history
  • Loading branch information
chris0765 committed Sep 30, 2022
1 parent 71f9655 commit 1ce685e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions collection/aws/ec2_collector/join_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 1ce685e

Please sign in to comment.