Save as tsv and remove excessive comments.
- User
Save as tsv and remove excessive comments.
Assistant
import pandas as pd import numpy as np import math df = pd.read_csv('deltacoverage-multi.tsv', sep='\t') max_score = df['sliding_scores'].max() bins = [-np.inf, 0] + list(range(1, math.ceil(max_score) + 1)) df['box'] = pd.cut(df['sliding_scores'], bins=bins, right=False, include_lowest=True) delta_cols = [col for col in df.columns if col.startswith('delta')] grouped_df = df.groupby('box')[delta_cols].mean() if 'delta0' in grouped_df.columns: grouped_df['delta0'] = 0 grouped_df = grouped_df.reset_index() grouped_df['box_start'] = grouped_df['box'].apply(lambda x: x.left) grouped_df['box_end'] = grouped_df['box'].apply(lambda x: x.right) grouped_df['box_start'] = grouped_df['box_start'].astype(object) grouped_df.loc[grouped_df['box_start'] == -np.inf, 'box_start'] = '-inf' output_cols = ['box_start', 'box_end'] + delta_cols output_df = grouped_df[output_cols] output_df.to_csv('average_deltas_by_box.tsv', sep='\t', index=False)
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.