def shape(self): ''' Find the number of rows and columns in a DataFrame ''' return self.count(), len(self.schema.names) pyspark.sql.DataFrame.shape = shape