<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def weight(self, weights):
 """Applies weighted mean to models. Parameters weights : list Returns ------- np.ndarray Examples """

        return self.apply(lambda x: np.average(x, axis=0, weights=weights))