title: How to pass a dataframe to the method of an object?
body: <p>Why does this code give the following error?</p>
  
  <blockquote>
    <p>TypeError: simple_returns() takes 1 positional argument but 2 were given</p>
  </blockquote>
  
  <pre><code>import datetime as dt
  import math
  from matplotlib import style
  import numpy as np
  import pandas as pd
  import pandas_datareader.data as web
  
  start = dt.datetime(2000, 1, 1)
  end = dt.datetime(2016, 12, 31)
  
  df = web.DataReader('TSLA', 'yahoo', start, end)
  
  
  class CalcReturns:
      def simple_returns(self):
          simple_ret = self.pct_change()
          return simple_ret
  
      def log_returns(self):
          simple_ret = self.pct_change()
          log_ret = np.log(1 + simple_ret)
          return log_ret
  
  
  myRet = CalcReturns()
  c = df['Adj Close']
  sim_ret = myRet.simple_returns(c)
  print(sim_ret)
  </code></pre>