<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_barycenter(self):
 """Return the mass weighted average location. Args: None Returns: :class:`numpy.ndarray`: """

        try:
            mass = self['mass'].values
        except KeyError:
            mass = self.add_data('mass')['mass'].values
        pos = self.loc[:, ['x', 'y', 'z']].values
        return (pos * mass[:, None]).sum(axis=0) / self.get_total_mass()