title: Why is `to_numpy()` recognized as an attribute rather than a method of dataframe?
body: <pre class="lang-py prettyprint-override"><code>import pandas as pd
  import numpy as np
  
  class CLF:
      Weights = 0
      
      def fit(DF_input, DF_output, eta=0.1, drop=1000):
          X, y = DF_input.to_numpy(copy=True), DF_output.to_numpy(copy=True)
          N,d = X.shape
          m = len(np.unique(y))   
          self.Weights = np.random.normal(0,1, size=(d,m))
  
  
  INPUT = pd.read_csv(path_input)
  OUTPUT = pd.read_csv(path_output)
  clf = CLF()
  clf.fit(INPUT, OUTPUT)
  </code></pre>
  <p>I defined a method <code>.fit()</code> for the class I wrote. The first step is convert two dataframes into numpy arrays. However, I got the following error when I tried to use the method, although <code>INPUT.to_numpy(copy=True)</code> and <code>OUTPUT.to_numpy(copy=True)</code> both work fine in their own right. Can somebody help me out here? Why was <code>to_numpy</code> recognized as an <strong>attribute</strong> rather than a <strong>method of dataframes</strong>?</p>
  <pre><code>---------------------------------------------------------------------------
  AttributeError                            Traceback (most recent call last)
  &lt;ipython-input-22-a3d455104534&gt; in &lt;module&gt;
        1 clf = CLF()
  ----&gt; 2 clf.fit(INPUT, OUTPUT)
  
  &lt;ipython-input-16-57babd738b2d&gt; in fit(DF_input, DF_output, eta, drop)
        4 
        5     def fit(DF_input, DF_output, eta=0.1,drop=1000):
  ----&gt; 6         X, y = DF_input.to_numpy(copy=True), DF_output.to_numpy(copy=True)
        7         N,d = X.shape
        8         m = len(np.unique(y))   # number of classes
  
  AttributeError: 'CLF' object has no attribute 'to_numpy'
  </code></pre>