parse raw CSV into dictionary

def parse_to_dict(self):
        """
        parse raw CSV into dictionary
        """
        lst = []
        with open(self.fname, 'r') as f:
            hdr = f.readline()
            self.hdrs = hdr.split(',')
            #print("self.hdrs = ", self.hdrs)
            for line in f:
                cols = line.split(',')
                if len(cols) == len(self.hdrs):
                    #print(cols)
                    d = {}
                    for ndx, col_header in enumerate(self.hdrs):
                        #d[self.hdrs[ndx].strip('\n').strip()] = cols[ndx].strip('\n').strip()
                        d[col_header.strip('\n').strip()] = cols[ndx].strip('\n').strip()
                        
                    lst.append(d)
                else:
                    print("Error parsing " + self.fname + " line : " + line)
        return lst