When I try to append two or more dataframe and output the result to a csv, it shows like a waterfall format.
    dataset = pd.read_csv('testdata.csv')
  for i in segment_dist:
      for j in step:
          print_msg = str(i) + ":" + str(j)
          print("\n",i,":",j,"\n")
          temp = pd.DataFrame(estimateRsq(dataset,j,i),columns=[print_msg])
          csv = csv.append(temp)
  csv.to_csv('output.csv',encoding='utf-8', index=False)
estimateRsq() returns array. I think this much code snippet should be enough to help me out.
The format I am getting in output.csv is:

Please help, How can I shift the contents go up from index 1.