def minutes_degrees(coord, kywrd):
    """
    Converts coordinates from decimal minutes to decimal degrees

    Parameters
    ------------
    coord : str
        A single coordinate, either longitude or latitude, with a single char
        at the end indicating the hemisphere
    kywrd : str
        Indicates whether the coordinate is a latitude or longitude coordinate,
        as they are formatted differently

    Returns
    ------------
    deg : str
        Decimal degree coordinate
    """
    if (kywrd == 'lat'):
        deg = coord[:2]
        mins = coord[2:4]
    elif (kywrd == 'lon'):
        deg = coord[:3]
        mins = coord[3:5]
    else:
        print('Coordinate Transform error: Invalid keyword')
        return -1
    dec = float(mins) / 60
    deg = float(deg) + dec

    if (coord[-1] == "S" or coord[-1] == "W"):
        deg = deg * -1

    deg = str(deg)[:6]

    return deg