title: Applying a function to pandas dataframe
body: <p>I'm trying to perform some text analysis on a <code>pandas</code> <code>dataframe</code>, but am having some trouble with the flow.  Alternatively, maybe I just not getting it...  PS - I'm a python beginner-ish.</p>
  
  <p>Dataframe example: </p>
  
  <pre><code>df = pd.DataFrame({'Document' : ['a','1','a', '6','7','N'], 'Type' : ['7', 'E', 'Y', '6', 'C', '9']})
  
  
       Document   Type
  0    a          7
  1    1          E
  2    a          Y
  3    6          6
  4    7          C
  5    N          9
  </code></pre>
  
  <p>I'm trying to build a flow that if 'Document' or 'Type' is a number or not, do something.</p>
  
  <p>Here is a simple function to return whether 'Document' is a number (edited to show how I am trying some if/then flow on the field):</p>
  
  <pre><code>def fn(dfname):
      if dfname['Document'].apply(str.isdigit):
          dfname['Check'] = 'Y'
      else:
          dfname['Check'] = 'N'
  </code></pre>
  
  <p>Now, I <code>apply</code> it to the dataframe:  </p>
  
  <pre><code>df.apply(fn(df), axis=0)
  </code></pre>
  
  <p>I get this error back:  </p>
  
  <pre><code>TypeError: ("'NoneType' object is not callable", u'occurred at index Document')
  </code></pre>
  
  <p>From the error message, it looks that I am not handling the index correctly.  Can anyone see where I am going wrong?</p>
  
  <p>Lastly - this may or may not be related to the issue, but I am really struggling with how <code>indexes</code> work in <code>pandas</code>.  I think I have run into more issues with the index than any other issue. </p>