<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def impute_element(self, records=('ATOM', 'HETATM'), inplace=False):
 """Impute element_symbol from atom_name section. Parameters records : iterable, default: ('ATOM', 'HETATM') Coordinate sections for which the element symbols should be imputed. inplace : bool, (default: False Performs the operation in-place if True and returns a copy of the PDB DataFrame otherwise. Returns --------- DataFrame """

        if inplace:
            t = self.df
        else:
            t = self.df.copy()
            for d in self.df:
                t[d] = self.df[d].copy()

        for sec in records:
            t[sec]['element_symbol'] = \
                t[sec][['atom_name', 'element_symbol']].\
                apply(lambda x: x[0][1]
                      if len(x[1]) == 3
                      else x[0][0], axis=1)
        return t