character refine
This commit is contained in:
6
plots.py
6
plots.py
@@ -40,8 +40,9 @@ def plot_average_scores_with_counts(
|
||||
Plotly figure object.
|
||||
"""
|
||||
# Calculate average and count of non-null values for each column
|
||||
# Exclude _recordId column
|
||||
stats = []
|
||||
for col in df.columns:
|
||||
for col in [c for c in df.columns if c != '_recordId']:
|
||||
avg_score = df[col].mean()
|
||||
non_null_count = df[col].drop_nulls().len()
|
||||
stats.append({
|
||||
@@ -126,8 +127,9 @@ def plot_top3_ranking_distribution(
|
||||
go.Figure
|
||||
Plotly figure object.
|
||||
"""
|
||||
# Exclude _recordId column
|
||||
stats = []
|
||||
for col in df.columns:
|
||||
for col in [c for c in df.columns if c != '_recordId']:
|
||||
# Count occurrences of each rank (1, 2, 3)
|
||||
# We ensure we're just counting the specific integer values
|
||||
rank1 = df.filter(pl.col(col) == 1).height
|
||||
|
||||
Reference in New Issue
Block a user