title: How to loop through columns in a dataframe?
body: <p>I have a dataframe with many metric columns all containing float output. I need to round them all to four digits. I want to loop through all the columns to do this. </p>
  
  <pre><code>import numpy as np
  import pandas as pd
  
  test_df = pd.DataFrame(np.random.randn(10,4), columns=['a','b','c','d'])
  
  metrics = test_df.columns
  metrics = metrics.tolist()
  
  for x in metrics:
      test_df.x = np.round(test_df.x, 4)
  </code></pre>
  
  <p>However, this gives me the error: </p>
  
  <pre><code>AttributeError: 'DataFrame' object has no attribute 'x'
  </code></pre>
  
  <p>Whats the best way to do this? </p>