title: How to deal with SettingWithCopyWarning in this case
body: <p>I've read the answers in <a href="https://stackoverflow.com/questions/20625582/how-to-deal-with-this-pandas-warning">How to deal with this Pandas warning?</a> but I can't figure out if I should ignore the SettingWithCopyWarning warning or if I'm doing something really wrong.</p>
  
  <p>I have this function that resamples some data to a specific time frame (1h for instance) and then fills the NaN values accordingly.</p>
  
  <pre><code>def resample_data(raw_data, time_frame):
      # resamples the ticker data in ohlc
      ohlc_dict = {
          'open': 'first',
          'high': 'max',
          'low': 'min',
          'close': 'last',
          'price': 'mean'
      }
  
      volume_dict = {'volume': 'sum', 'volume_quote': 'sum'}
  
      resampled_data = raw_data.resample(time_frame, how={'price': ohlc_dict, 'amount': volume_dict})
      resampled_data['amount'] = resampled_data['amount']['volume'].fillna(0.0)
      resampled_data['amount']['volume_quote'] = resampled_data['amount']['volume']
      resampled_data['price']['close'] = resampled_data['price']['close'].fillna(method='pad')
      resampled_data['price']['open'] = resampled_data['price']['open'].fillna(resampled_data['price']['close'])
      resampled_data['price']['high'] = resampled_data['price']['high'].fillna(resampled_data['price']['close'])
      resampled_data['price']['low'] = resampled_data['price']['low'].fillna(resampled_data['price']['close'])
      resampled_data['price']['price'] = resampled_data['price']['price'].fillna(resampled_data['price']['close'])
  
      # ugly hack to remove multi index, must be better way
      output_data = resampled_data['price']
      output_data['volume'] = resampled_data['amount']['volume']
      output_data['volume_quote'] = resampled_data['amount']['volume_quote']
  
      return output_data
  </code></pre>
  
  <p>Is this the right way to do it and should I ignore the warning?</p>
  
  <p>Edit: If I try to use .loc as sugested in the warning:</p>
  
  <pre><code>resampled_data = raw_data.resample(time_frame, how={'price': ohlc_dict, 'amount': volume_dict})
  resampled_data.loc['amount'] = resampled_data['amount']['volume'].fillna(0.0)
  resampled_data.loc['amount']['volume_quote'] = resampled_data['amount']['volume']
  resampled_data.loc['price']['close'] = resampled_data['price']['close'].fillna(method='pad')
  resampled_data.loc['price']['open'] = resampled_data['price']['open'].fillna(resampled_data['price']['close'])
  resampled_data.loc['price']['high'] = resampled_data['price']['high'].fillna(resampled_data['price']['close'])
  resampled_data.loc['price']['low'] = resampled_data['price']['low'].fillna(resampled_data['price']['close'])
  resampled_data.loc['price']['price'] = resampled_data['price']['price'].fillna(resampled_data['price']['close'])
  </code></pre>
  
  <p>I get the following error refering to line <code>resampled_data.loc['price']['close'] = resampled_data['price']['close'].fillna(method='pad')</code></p>
  
  <blockquote>
    <p>KeyError: 'the label [price] is not in the [index]'</p>
  </blockquote>