title: Efficiently building a pandas dataframe row by row
body: <p>I've been building pandas dataframes recently by iterating through multiple files, rows, etc. I've been building them by appending items in a dictionary and then converting to a dataframe:</p>
  
  <p>I understand there are other tools such as apply() and interrows() to step through rows and apply or screen data by row. That is not the topic of this question.</p>
  
  <pre><code>new_data_dict = {}
  for r in df.index:
      new_data = df.loc[r] **2
      new_data_dict[r] = new_data
  
  new_df = pd.DataFrame.from_dict(new_data_dict, orient = 'index')
  </code></pre>
  
  <p>Is this the most efficient way to build a pandas df? I haven't compared it to pandas.DataFrame.append. I've had two thoughts about append. On one hand seems unnecessarily heavy to create a dataframe or series (of a single row) only to append it. On the otherhand everything built into pandas is super fast such as the above methods apply() and iterrows() as well as groupby() etc.</p>
  
  <p>What is the 'pandamic' way to build a dataframe row by row?</p>