title: ValueError: Length of values (1) does not match length of index index (12797) - Indexes are the same length
body: <p>So this is driving me crazy now, cause I really don't see the problem.</p>
  <p>I have the following code:</p>
  <pre class="lang-py prettyprint-override"><code>    dataframe.to_csv(f&quot;user_data/candle_data.csv&quot;)
      print (dataframe)
  
      st12 = self.supertrend(dataframe, 3, 12)
      st12['ST'].to_csv(f&quot;user_data/st12.csv&quot;)
      print (st12)
  
      print(dataframe.index.difference(st12.index))
  
      dataframe.loc[:, 'st_12'] = st12['ST'], 
  </code></pre>
  <p>Checking the <code>csv</code> files and I can see that the first index is <code>0</code> and the last index is <code>12796</code>.  The last row is also on line number <code>12798</code>. This is true for both files.</p>
  <p>The output from three <code>print</code> is as follows</p>
  <pre><code>                           date     open     high      low    close       volume
  0     2020-12-29 21:45:00+00:00   723.33   726.14   723.26   725.05   3540.48612
  1     2020-12-29 22:00:00+00:00   725.17   728.77   723.78   726.94   3983.90892
  2     2020-12-29 22:15:00+00:00   726.94   727.30   724.72   724.75   3166.57435
  3     2020-12-29 22:30:00+00:00   724.94   725.99   723.80   725.91   2848.08122
  4     2020-12-29 22:45:00+00:00   725.99   730.30   725.95   729.64   6288.69499
  ...                         ...      ...      ...      ...      ...          ...
  12792 2021-05-12 03:45:00+00:00  4292.42  4351.85  4292.35  4332.81  24410.30155
  12793 2021-05-12 04:00:00+00:00  4332.12  4347.60  4300.07  4343.05  16545.66776
  12794 2021-05-12 04:15:00+00:00  4342.84  4348.00  4305.87  4313.82  10048.32828
  12795 2021-05-12 04:30:00+00:00  4313.82  4320.68  4273.35  4287.49  13201.88547
  12796 2021-05-12 04:45:00+00:00  4287.49  4306.79  4276.87  4300.80   9663.73327
  
  [12797 rows x 6 columns]
                  ST  STX
  0         0.000000  nan
  1         0.000000  nan
  2         0.000000  nan
  3         0.000000  nan
  4         0.000000  nan
  ...            ...  ...
  12792  4217.075684   up
  12793  4217.075684   up
  12794  4217.260609   up
  12795  4217.260609   up
  12796  4217.260609   up
  
  [12797 rows x 2 columns]
  RangeIndex(start=0, stop=0, step=1)
  </code></pre>
  <p>Full Error Traceback:</p>
  <pre><code>Traceback (most recent call last):
    File &quot;/freqtrade/freqtrade/main.py&quot;, line 37, in main
      return_code = args['func'](args)
    File &quot;/freqtrade/freqtrade/commands/optimize_commands.py&quot;, line 53, in start_backtesting
      backtesting.start()
    File &quot;/freqtrade/freqtrade/optimize/backtesting.py&quot;, line 479, in start
      min_date, max_date = self.backtest_one_strategy(strat, data, timerange)
    File &quot;/freqtrade/freqtrade/optimize/backtesting.py&quot;, line 437, in backtest_one_strategy
      preprocessed = self.strategy.ohlcvdata_to_dataframe(data)
    File &quot;/freqtrade/freqtrade/strategy/interface.py&quot;, line 670, in ohlcvdata_to_dataframe
      return {pair: self.advise_indicators(pair_data.copy(), {'pair': pair})
    File &quot;/freqtrade/freqtrade/strategy/interface.py&quot;, line 670, in &lt;dictcomp&gt;
      return {pair: self.advise_indicators(pair_data.copy(), {'pair': pair})
    File &quot;/freqtrade/freqtrade/strategy/interface.py&quot;, line 687, in advise_indicators
      return self.populate_indicators(dataframe, metadata)
    File &quot;/freqtrade/user_data/strategies/TrippleSuperTrendStrategy.py&quot;, line 94, in populate_indicators
      dataframe.loc[:, 'st_12'] = st12['ST'],
    File &quot;/home/ftuser/.local/lib/python3.9/site-packages/pandas/core/indexing.py&quot;, line 692, in __setitem__
      iloc._setitem_with_indexer(indexer, value, self.name)
    File &quot;/home/ftuser/.local/lib/python3.9/site-packages/pandas/core/indexing.py&quot;, line 1597, in _setitem_with_indexer
      self.obj[key] = value
    File &quot;/home/ftuser/.local/lib/python3.9/site-packages/pandas/core/frame.py&quot;, line 3163, in __setitem__
      self._set_item(key, value)
    File &quot;/home/ftuser/.local/lib/python3.9/site-packages/pandas/core/frame.py&quot;, line 3242, in _set_item
      value = self._sanitize_column(key, value)
    File &quot;/home/ftuser/.local/lib/python3.9/site-packages/pandas/core/frame.py&quot;, line 3899, in _sanitize_column
      value = sanitize_index(value, self.index)
    File &quot;/home/ftuser/.local/lib/python3.9/site-packages/pandas/core/internals/construction.py&quot;, line 751, in sanitize_index
      raise ValueError(
  ValueError: Length of values (1) does not match length of index (12797)
  ERROR: 1
  </code></pre>
  <p>So if both data frames have exactly the same amount of rows and the indexes are exactly the same, why am I getting this error?</p>