Skip to content

Commit

Permalink
Fixed failing build
Browse files Browse the repository at this point in the history
  • Loading branch information
adnanhemani committed Jan 27, 2023
1 parent 3d19236 commit d4dbb6f
Showing 1 changed file with 28 additions and 15 deletions.
43 changes: 28 additions & 15 deletions datascience/tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -5682,11 +5682,10 @@ class Rows(collections.abc.Sequence):
An iterable view over the rows in a table.
>>> t = Table().with_columns({
'letter': ['a', 'b', 'c', 'z'],
'count': [ 9, 3, 3, 1],
'points': [ 1, 2, 2, 10],
})
... 'letter': ['a', 'b', 'c', 'z'],
... 'count': [ 9, 3, 3, 1],
... 'points': [ 1, 2, 2, 10],
... })
>>> rows = Table.Rows(t)
>>> rows
Rows(letter | count | points
Expand All @@ -5696,7 +5695,7 @@ class Rows(collections.abc.Sequence):
z | 1 | 10)
Args:
table- accepts a table instance of class Table
table: accepts a table instance of class Table
Returns:
An instance of Rows class
Expand All @@ -5712,11 +5711,17 @@ def __getitem__(self, i):
rows[i] is equivalent to rows.__getitem__(i)
>>> r[0]
>>> t = Table().with_columns({
... 'letter': ['a', 'b', 'c', 'z'],
... 'count': [ 9, 3, 3, 1],
... 'points': [ 1, 2, 2, 10],
... })
>>> rows = Table.Rows(t)
>>> rows[0]
Row(letter='a', count=9, points=1)
Args:
i- index of the Row that needs to be accessed.
i: index of the Row that needs to be accessed.
Returns:
Returns a Row instance containing the i-th row of the given table
Expand All @@ -5735,7 +5740,13 @@ def __len__(self):
"""
Returns the number of rows in the table.
>>> len(r)
>>> t = Table().with_columns({
... 'letter': ['a', 'b', 'c', 'z'],
... 'count': [ 9, 3, 3, 1],
... 'points': [ 1, 2, 2, 10],
... })
>>> rows = Table.Rows(t)
>>> len(rows)
4
"""
Expand All @@ -5748,13 +5759,15 @@ def __repr__(self):
repr(rows) is equivalent to rows.__repr__()
>>> t = Table().with_columns({
... 'letter': ['a', 'b', 'c', 'z'],
... 'count': [ 9, 3, 3, 1],
... 'points': [ 1, 2, 2, 10],
... })
>>> rows = Table.Rows(t)
>>> repr(rows)
'Rows(letter | count | points\n
a | 9 | 1\n
b | 3 | 2\n
c | 3 | 2\n
z | 1 | 10)'
'Rows(letter | count | points\\na | 9 | 1\\nb | 3 | 2\\nc | 3 | 2\\nz | 1 | 10)'
"""
return '{0}({1})'.format(type(self).__name__, repr(self._table))

Expand Down

0 comments on commit d4dbb6f

Please sign in to comment.