def __rm_duplicate_citation_2(self, key):
        """
        Remove exact duplicate entries for abstract or citation fields. Check all publication entries.
        :return:
        """
        citations = []
        # Before writing, remove any duplicate "Full_Citations" that are found
        for idx, pub in enumerate(self.noaa_data_sorted["Publication"]):
            try:
                citations.append(pub[key])
            except KeyError:
                # Key was not found. Enter a blank entry in citations list
                citations.append("")

        # Create a backwards dictionary, that lists which indexes are duplicates
        d = defaultdict(list)
        for i, item in enumerate(citations):
            d[item].append(i)
        d = {k: v for k, v in d.items() if len(v) > 1}
        # Duplicates indexes are listed like so:
        # {"full citation info here": [0, 2, 5]}

        # Loop over duplicate indexes
        for citation, idxs in d.items():
            # do not process any duplicate entries that were initially blanks.
            if citation:
                # Loop for [1:], since we want to keep the first citation and remove the rest.
                for idx in idxs[1:]:
                    # Set citation to blank
                    self.noaa_data_sorted["Publication"][idx][key] = ""
def __rm_duplicate_citation_2 ( self , key ) : citations = [ ] for idx , pub in enumerate ( self . noaa_data_sorted [ "Publication" ] ) : try : citations . append ( pub [ key ] ) except KeyError : citations . append ( "" ) d = defaultdict ( list ) for i , item in enumerate ( citations ) : d [ item ] . append ( i ) d = { k : v for k , v in d . items ( ) if len ( v ) > 1 } for citation , idxs in d . items ( ) : if citation : for idx in idxs [ 1 : ] : self . noaa_data_sorted [ "Publication" ] [ idx ] [ key ] = ""
Remove exact duplicate entries for abstract or citation fields. Check all publication entries.
        :return: