title: How do I pass a function parameter into a lambda function subsequently
body: <p>I am trying to pass in the <code>timeframe='month'</code> parameter into my function. I tried applying with lambda function but it doesn't seem to work.</p>
  <pre><code>def a(query_date=pd.DatetimeIndex(['2016-12-31']), timeframe = 'month'):
    a = query_date.to_series().apply(lambda x:x.timeframe)
    print(a)
  </code></pre>
  <p>Any advice on how to apply my timeframe inside? I want to able to extract the day, month or year with a function.</p>