title: No axis named 1 for object type <class 'pandas.core.series.Series'>
body: <p>I am creating a portfolio that consists of investing 100 000 USD every time I generate my purchase signals. This is my code:</p>
  
  <pre><code>initial_capital= float(100000.0)
  positions = pd.DataFrame(index=signals.index).fillna(0.0)
  No_acciones = (initial_capital / GFG['Close']).astype(int)
  positions['GFG'] = No_acciones*signals['signal']   
  portfolio = positions.multiply(GFG['Close'], axis=0)
  portfolio['holdings'] =(positions.multiply(GFG['Close'],axis=0)).sum(axis=1)
  portfolio['cash'] = initial_capital - (positions['GFG'].multiply(GFG['Close'], axis=0)).sum(axis=1).cumsum()   
  portfolio['total'] = portfolio['cash'] + portfolio['holdings']
  portfolio['returns'] = portfolio['total'].pct_change()
  print(portfolio.head())
  </code></pre>
  
  <p>I get this error and I do not understand why:</p>
  
  <blockquote>
    <p>File "C:\Users\Usuario\Anaconda3\lib\site-packages\pandas\core\generic.py", line 357, in _get_axis_number
        .format(axis, type(self)))</p>
    
    <p>ValueError: No axis named 1 for object type </p>
  </blockquote>