<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def amino3to1(self, record='ATOM', residue_col='residue_name', fillna='?'):
 """Creates 1-letter amino acid codes from DataFrame Non-canonical amino-acids are converted as follows: ASH (protonated ASP) => D CYX (disulfide-bonded CYS) => C GLH (protonated GLU) => E HID/HIE/HIP (different protonation states of HIS) = H HYP (hydroxyproline) => P MSE (selenomethionine) => M Parameters record : str, default: 'ATOM' Specfies the record DataFrame. residue_col : str, default: 'residue_name' Column in `record` DataFrame to look for 3-letter amino acid codes for the conversion. fillna : str, default: '?' Placeholder string to use for unknown amino acids. Returns --------- pandas.DataFrame : Pandas DataFrame object consisting of two columns, `'chain_id'` and `'residue_name'`, where the former contains the chain ID of the amino acid and the latter contains the 1-letter amino acid code, respectively. """

        tmp = self.df[record]
        cmp = 'placeholder'
        indices = []

        for num, ind in zip(tmp['residue_number'], np.arange(tmp.shape[0])):
            if num != cmp:
                indices.append(ind)
            cmp = num

        transl = tmp.iloc[indices][residue_col].map(
            amino3to1dict).fillna(fillna)

        return pd.concat((tmp.iloc[indices]['chain_id'], transl), axis=1)