class which reads the file content
<p>I'd like to write class which reads the *.csv file and parse it using the pandas library. I'm wondering where I should initialize df. </p>

<pre><code>#!/usr/bin/env python
import pandas as pd
import os

class ParseDataBase(object):
        def __init__(self, name_file):
                self.name_file = name_file

        def read_file(self):
                """Read the file concent"""

                try:
                        self.df = pd.read_csv(self.name_file)
                except IndexError:
                        print ("Error: Wrong file name")
                        sys.exit(2)
                return self.df

        def dispaly_file(self):
                print self.df

def main():
        x = ParseDataBase('something.csv')
        x.dispaly_file()

if __name__ == '__main__':
        main()
</code></pre>

<p>The above code returns the following error: <code>'ParseDataBase' object has no attribute 'df'</code>. </p>

<p>I don't want to pass to many variables while crating the object.</p>

<p>I'm new to object oriented programming, so any comments and hints are highly appreciated! </p>