resultToDataframe function

Convert result to dataframe