title: how to round down inf values
body: <p>I have a dataframe with multiple columns and I want to calculate some averages, however the result is often an <code>inf</code> value, which is messing up my dataframe. Is it possible to round down the <code>inf</code> value in Python?</p>
  
  <p>Some example of code:</p>
  
  <pre><code>df['Htgs/2'] = df.groupby('Home Team', ) ['Hg'].rolling(window=a, min_periods=a ).mean().reset_index(0,drop=True)
  df['Htgs/2']= (((df['Htgs/2'] * a) - df['Hg']) / (a-1)) / df['Lha']
  df['Agcr/2'] = df.groupby('Away Team', ) ['Agcr'].rolling(window=a, min_periods=a ).mean().reset_index(0,drop=True)
  df['Agsr/2']= (((df['Agcr/2'] * a) - df['Agcr']) / (a-1))
  df = df.round(decimals=3)
  </code></pre>