def imputation(matrix, nan_filling):
    """
    takes in matrix dataframe and value for filling in NaNs for imputation

    Parameters: matrix dataframe, NaN filling value
    Returns: imputed matrix dataframe
    """
    matrix.fillna(nan_filling, inplace=True)
    return matrix