James McCool
commited on
Commit
·
5c8315f
1
Parent(s):
31a2d34
Update create_general_comparison.py to refine overall general calculation
Browse files- Adjusted the logic for calculating the overall general value to differentiate between 'Overall' and specific entrants, ensuring accurate representation of data.
- Updated the length calculation for general contests to reflect the correct subset based on the selected entrant, improving data accuracy in comparisons.
global_func/create_general_comparison.py
CHANGED
@@ -10,9 +10,11 @@ def create_general_comparison(df: pd.DataFrame, entrants: list = None):
|
|
10 |
|
11 |
if entrant == 'Overall':
|
12 |
overall_general = pd.Series(list(df[each_col])).sum()
|
|
|
13 |
else:
|
14 |
overall_general = pd.Series(list(df[df['BaseName'] == entrant][each_col])).sum()
|
15 |
-
|
|
|
16 |
each_set_name = ['Overall']
|
17 |
each_general_set = [overall_general]
|
18 |
each_general_len_set = [general_contest_len]
|
|
|
10 |
|
11 |
if entrant == 'Overall':
|
12 |
overall_general = pd.Series(list(df[each_col])).sum()
|
13 |
+
general_contest_len = len(df)
|
14 |
else:
|
15 |
overall_general = pd.Series(list(df[df['BaseName'] == entrant][each_col])).sum()
|
16 |
+
general_contest_len = len(df[df['BaseName'] == entrant])
|
17 |
+
|
18 |
each_set_name = ['Overall']
|
19 |
each_general_set = [overall_general]
|
20 |
each_general_len_set = [general_contest_len]
|