Q:

method within class is not callable within that class?

If I have a file, foo.py with contents:
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())

What I would like to do with this is something like this:
test = Marcher(p_path='/some/path/to/file.csv')
test.m1

However when I try this I get back an error:
TypeError: first_call() takes exactly 1 argument (0 given)

A:

why do you want m1 to be a class member variable? just move the call like this:
def __init__(self, path):
    self.path = path
    self.m1 = self.p_to_i(self.first_call())

