Skip to content

Commit

Permalink
add method and tests for method
Browse files Browse the repository at this point in the history
  • Loading branch information
sammychoco authored and samukweku committed Jan 3, 2023
1 parent 56317c6 commit da2c467
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/test-f.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,3 +493,11 @@ def test_nth():
assert_equals(DT[:, f.A.nth(n=0)], DT[:, dt.nth(f.A, 0)])
assert_equals(DT[:, f.A.nth(n=0)], DT[:, dt.nth(f.A, 0)])


def test_nth():
assert str(dt.nth(f.A, nth=0)) == str(f.A.nth(nth=0))
assert str(dt.nth(f.A, nth=1)) == str(f.A.nth(nth=1))
assert str(dt.nth(f[:], -1)) == str(f[:].nth(-1))
DT = dt.Frame(A = [9, 8, 2, 3, None, None, 3, 0, 5, 5, 8, None, 1])
assert_equals(DT[:, f.A.nth(nth=1)], DT[:, dt.nth(f.A, 1)])
assert_equals(DT[:, f.A.nth(nth=0)], DT[:, dt.nth(f.A, 0)])

0 comments on commit da2c467

Please sign in to comment.