<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def parse_duplicate_stats(self, stats_file):
 """ Parses sambamba markdup output, returns series with values. :param str stats_file: sambamba output file with duplicate statistics. """

        import pandas as pd
        series = pd.Series()
        try:
            with open(stats_file) as handle:
                content = handle.readlines()  # list of strings per line
        except:
            return series
        try:
            line = [i for i in range(len(content)) if "single ends (among them " in content[i]][0]
            series["single-ends"] = re.sub("\D", "", re.sub("\(.*", "", content[line]))
            line = [i for i in range(len(content)) if " end pairs...   done in " in content[i]][0]
            series["paired-ends"] = re.sub("\D", "", re.sub("\.\.\..*", "", content[line]))
            line = [i for i in range(len(content)) if " duplicates, sorting the list...   done in " in content[i]][0]
            series["duplicates"] = re.sub("\D", "", re.sub("\.\.\..*", "", content[line]))
        except IndexError:
            pass
        return series