def accom_replace(df):
    """
    replaces values of the variable "SettledAccommodationInd" from input dataset 
    to the format used for analysis and visualisation
    Grouped in to 'in accommodation' or 'not in accommodation'
    
    Parameters
    ----------
    df : main datatset
        
    Returns
    -------
    df : main dataset after replacement
    """
    accom_replaced_values = {"Y": "1", "N": "0", "Z": "0", "9": "0"}
    df.SettledAccommodationInd = [accom_replaced_values[item] for item in df.SettledAccommodationInd]
    return df