def to_dict(node): table = table_json(node) if not table: mode = stats.mode(table_data_count(node)) rows = [tds for tds in (node) if len(tds) == mode] table = {str(col): [' '.join(row[col].text_content().split()) for row in rows] for col in range(mode)} return table
def test_mode(self): m = mode(self.ints + [1]) assert m == 1
def mode(self): """ """ return stats.mode(self.values())