method within class is not callable within that class?
<p>If I have a file, foo.py with contents:</p>

<pre><code>import pandas as pd

class Marcher(object):
    def __init__(self, p_path):
        self.p_path = p_path

    p_m = 'ID'

    def first_call(self):
        df_p = pd.read_csv(self.p_path, header=None)
        return df_p

    def p_to_i(self, p):
        pii = p.set_index(self.p_m, drop=False).loc[p[self.p_m]]
        return pii

    m1 = p_to_i(first_call())
</code></pre>

<p>What I would like to do with this is something like this:</p>

<pre><code>test = Marcher(p_path='/some/path/to/file.csv')
test.m1
</code></pre>

<p>However when I try this I get back an error:</p>

<pre><code>TypeError: first_call() takes exactly 1 argument (0 given)
</code></pre>

<p>why do you want <code>m1</code> to be a class member variable? just move the call like this:</p>

<pre><code>def __init__(self, path):
    self.path = path
    self.m1 = self.p_to_i(self.first_call())
</code></pre>

python