title: Why dataframe exports only last value of iteration to csv? (Python)
body: <p>I am exporting results from dataframe to CSV, but it only exports the last value of the iteration. Please check my code and let me know, where I am doing wrong. Thank you for your support.</p>
  <pre><code>from pyswmm import Simulation, LidGroups, Nodes
  from pyswmm.swmm5 import SWMMException
  import os
  import pandas as pd
  
  
  
  output_path = &quot;E:\VARS_Research\pyswmm_master\Test_Model\Test_Model_Manual&quot;
  output_csv_file = &quot;node_flow.csv&quot;
  
  with Simulation('Test_model_LID.inp') as sim:
      nodes = Nodes(sim)
      
      for step in sim:
          j1 = Nodes(sim)[&quot;J1&quot;]
          j2 = Nodes(sim)[&quot;J2&quot;]
          j3 = Nodes(sim)[&quot;J3&quot;]
          j4 = Nodes(sim)[&quot;J4&quot;]
          results = {j1.total_inflow, j2.total_inflow, j3.total_inflow, j4.total_inflow} 
          sim.step_advance(300)
          
          for i in results:
              current_time = sim.current_time
              my_df = pd.DataFrame.from_dict({'j1': [j1.total_inflow], 'j2': [j2.total_inflow], 'j3': [j3.total_inflow], 'j4': [j4.total_inflow]})
              my_df.to_csv(os.path.join(output_path, &quot;node_flow.csv&quot;))
  </code></pre>