code: def filter(self, condition):
          
          if isinstance(condition, basestring):
              jdf = self._jdf.filter(condition)
          elif isinstance(condition, Column):
              jdf = self._jdf.filter(condition._jc)
          else:
              raise TypeError("condition should be string or Column")
          return DataFrame(jdf, self.sql_ctx)
docs: Filters rows using the given condition.
  
          :func:`where` is an alias for :func:`filter`.
  
          :param condition: a :class:`Column` of :class:`types.BooleanType`
              or a string of SQL expression.
  
          >>> df.filter(df.age > 3).collect()
          [Row(age=5, name=u'Bob')]
          >>> df.where(df.age == 2).collect()
          [Row(age=2, name=u'Alice')]
  
          >>> df.filter("age > 3").collect()
          [Row(age=5, name=u'Bob')]
          >>> df.where("age = 2").collect()
          [Row(age=2, name=u'Alice')]