title: How can I apply a python function to a pandas dataframe in Alteryx?
body: <p>I have a read in a workflow successfully but when I try and apply a function to a row of the data and output it as another row I get an error.
  The following is my curent code;</p>
  <pre><code>from ayx import Alteryx
  import pandas
  data = Alteryx.read(&quot;#1&quot;)
  
  def get_weekday_occurrences(date_string):
      year_day = datetime.strptime(date_string, '%Y_%m_%d').timetuple().tm_yday
      return math.ceil(year_day / 7)
  data['Name'] = data['Name'].apply(lambda x: datetime.strptime(x, '%Y_%m_%d'))
  data['Name'] = data.apply(lambda row : get_weekday_occurrences(data[&quot;Name&quot;]), axis = 1)
  </code></pre>
  <p>This code gives me the following error;</p>
  <pre><code>TypeError: ('strptime() argument 1 must be str, not Series', 'occurred at index 0')
  </code></pre>
  <p>What am I doing wring please?</p>