title: proper use of class (csv reader example)
body: <p>I've done the following CSV reader class:</p>
  
  <pre><code>class CSVread(object):
      filtered = []
  
      def __init__(self, file):
          self.file = file
  
      def get_file(self):
          try:
              with open(self.file, "r") as f:
                  self.reader = [row for row in csv.reader(f, delimiter = ";")]
                  return self.reader
          except IOError as err:
              print("I/O error({0}): {1}".format(errno, strerror))
          return
  
      def get_num_rows(self):
          print(sum(1 for row in self.reader))
  </code></pre>
  
  <p>Which can be used with the following example:</p>
  
  <pre><code>datacsv = CSVread("data.csv") # ; seperated file
  
  for row in datacsv.get_file(): # prints all the rows
      print(row)
  
  datacsv.get_num_rows() # number of rows in data.csv
  </code></pre>
  
  <p>My goal is to filter out the content of the csv  file (data.csv) by filtering column 12 by the keyword "00GG". I can get it to work outside the class like this:</p>
  
  <pre><code>with open("data.csv") as csvfile:
      reader = csv.reader(csvfile, delimiter = ";")
      filtered = []
      filtered = filter((lambda row: row[12] in ("00GG")), list(reader))
  </code></pre>
  
  <p>Code below returns an empty list (filtered) when it's defined inside the class:</p>
  
  <pre><code>def filter_data(csv_file):
      filtered = filter((lambda row: row[12] in ("00GGL")), self.reader)
      return filtered
  </code></pre>
  
  <p>Feedback for the existing code is also appreciated.</p>