Skip to content

Commit

Permalink
nan value handling
Browse files Browse the repository at this point in the history
  • Loading branch information
cdolfi committed Feb 2, 2024
1 parent 0dc26d9 commit 854df73
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions 8Knot/pages/chaoss/visualizations/project_velocity.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,9 @@ def process_data(
# df_consolidated combines the actions and unique contributors and then specific columns for visualization use are added on
df_consolidated = pd.concat([df_actions, df_cntrbs], axis=1).reset_index()

# replace all nan to 0
df_consolidated.fillna(value=0, inplace=True)

# log of commits and contribs
df_consolidated["log_num_commits"] = df_consolidated["Commit"].apply(math.log)
df_consolidated["log_num_contrib"] = df_consolidated["num_unique_contributors"].apply(math.log)
Expand All @@ -341,6 +344,9 @@ def process_data(
+ df_consolidated["PR Closed"] * pr_c_weight
)

# after weighting replace 0 with nan for log
df_consolidated["prs_issues_actions_weighted"].replace(0, np.nan, inplace=True)

# column for log value of pr and issue actions
df_consolidated["log_prs_issues_actions_weighted"] = df_consolidated["prs_issues_actions_weighted"].apply(math.log)

Expand Down

0 comments on commit 854df73

Please sign in to comment.