<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def compute_balance_median(self, ts, t):
 """ Compute the balance at either end."""

        return np.median(ts[t + 1:]) - np.median(ts[:t + 1])