def collapse_initials(name):
    """ Removes the space between initials.
        eg T. A. --> T.A."""
    if len(name.split()) > 1:
        name = re.sub(r'([A-Z]\.) +(?=[A-Z]\.)', r'\1', name)
    return name
def collapse_initials(name):
    """ Removes the space between initials.
        eg T. A. --> T.A."""
    if len(name.split()) > 1:
        name = re.sub(r'([A-Z]\.) +(?=[A-Z]\.)', r'\1', name)
    return name
def collapse_initials ( name ) : if len ( name . split ( ) ) > 1 : name = re . sub ( r'([A-Z]\.) +(?=[A-Z]\.)' , r'\1' , name ) return name
Removes the space between initials.
        eg T. A. --> T.A.
Removes the space between initials . eg T . A . -- > T . A .