title: How to sum a slice from a pandas dataframe
body: <p>I'm trying to sum the a portion of the sessions in my dictionary so I can get totals for the current and previous week.</p>
  
  <p>I've converted the JSON into a pandas dataframe in one test. I'm summing the total of the sessions using the .sum() function in pandas. However, I also need to know the total sessions from this week and the week prior. I've tried a few methods to sum values (-1:-7) and (-8:-15), but I'm pretty sure I need to use .iloc.  </p>
  
  <p>IN:</p>
  
  <pre><code>response = requests.get("url")
  data = response.json()
  df=pd.DataFrame(data['DailyUsage'])
  
  total_sessions = df['Sessions'].sum()
  current_week= df['Sessions'].iloc[-1:-7]
  print(current_week) 
  total_sessions =['current_week'].sum
  </code></pre>
  
  <p>OUT:</p>
  
  <pre><code>Series([], Name: Sessions, dtype: int64)
  AttributeError 'list' object has no attribute 'sum'
  </code></pre>
  
  <p>Note: I've tried this with and without pd.to_numeric and also with variations on the syntax of the slice and sum methods. Pandas doesn't feel very Pythonic and I'm out of ideas as to what to try next.  </p>