def pandas_table_to_nested_list(df):
    """
    Converts pandas table df to nested list
    """
    table_data = [["" for x in range(df.shape[1])] for y in range(df.shape[0]+1)]
    
    # Columns names
    for i in range(df.shape[1]):
        table_data[0][i] = df.columns[i]
        
    for i in range(df.shape[0]):
        for j in range(df.shape[1]):
            table_data[i+1][j] = df.iat[i, j]
    
    return table_data