-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #137 from narwhals-dev/eq-ne
Add series eq/ne
- Loading branch information
Showing
3 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from typing import Any | ||
|
||
import pandas as pd | ||
import polars as pl | ||
import pytest | ||
|
||
import narwhals as nw | ||
|
||
data = [1, 2, 3] | ||
|
||
|
||
@pytest.mark.parametrize("constructor", [pd.Series, pl.Series]) | ||
def test_eq_ne(constructor: Any) -> None: | ||
s = nw.from_native(constructor(data), series_only=True) | ||
assert (s == 1).to_numpy().tolist() == [True, False, False] | ||
assert (s != 1).to_numpy().tolist() == [False, True, True] |