When a DataFrame has duplicate column names (e.g. from time comparison
post-processing), `df[column]` returns a DataFrame instead of a Series.
Calling `.isna().all()` on a DataFrame produces a Series of booleans,
which raises "truth value of a Series is ambiguous" in the `if` check.
Fix by using positional indexing (`df.iloc[:, i]`) to always retrieve a
single Series regardless of duplicate column names.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>