diff --git a/pyproject.toml b/pyproject.toml index 4cccbdc..49c273d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -92,7 +92,7 @@ select = [ "D300", "D417", "D419", - + "NPY201", ] ignore = [ diff --git a/tests/nested_pandas/nestedframe/test_nestedframe.py b/tests/nested_pandas/nestedframe/test_nestedframe.py index fffbbe9..7590fce 100644 --- a/tests/nested_pandas/nestedframe/test_nestedframe.py +++ b/tests/nested_pandas/nestedframe/test_nestedframe.py @@ -174,10 +174,10 @@ def test_query(): def test_dropna(): """Test that dropna works on all layers""" - base = NestedFrame(data={"a": [1, 2, 3], "b": [2, np.NaN, 6]}, index=[0, 1, 2]) + base = NestedFrame(data={"a": [1, 2, 3], "b": [2, np.nan, 6]}, index=[0, 1, 2]) nested = pd.DataFrame( - data={"c": [0, 2, 4, 1, np.NaN, 3, 1, 4, 1], "d": [5, 4, 7, 5, 3, 1, 9, 3, 4]}, + data={"c": [0, 2, 4, 1, np.nan, 3, 1, 4, 1], "d": [5, 4, 7, 5, 3, 1, 9, 3, 4]}, index=[0, 0, 0, 1, 1, 1, 2, 2, 2], ) @@ -216,10 +216,10 @@ def test_dropna_layer_as_base_column(): def test_dropna_inplace_base(): """Test in-place behavior of dropna""" - base = NestedFrame(data={"a": [1, 2, 3], "b": [np.NaN, 4, 6]}, index=[0, 1, 2]) + base = NestedFrame(data={"a": [1, 2, 3], "b": [np.nan, 4, 6]}, index=[0, 1, 2]) nested = pd.DataFrame( - data={"c": [0, 2, 4, 1, np.NaN, 3, 1, 4, 1], "d": [5, 4, 7, 5, 3, 1, 9, 3, 4]}, + data={"c": [0, 2, 4, 1, np.nan, 3, 1, 4, 1], "d": [5, 4, 7, 5, 3, 1, 9, 3, 4]}, index=[0, 0, 0, 1, 1, 1, 2, 2, 2], ) @@ -237,10 +237,10 @@ def test_dropna_inplace_base(): def test_dropna_inplace_nested(): """Test in-place behavior of dropna""" - base = NestedFrame(data={"a": [1, 2, 3], "b": [np.NaN, 4, 6]}, index=[0, 1, 2]) + base = NestedFrame(data={"a": [1, 2, 3], "b": [np.nan, 4, 6]}, index=[0, 1, 2]) nested = pd.DataFrame( - data={"c": [0, 2, 4, 1, np.NaN, 3, 1, 4, 1], "d": [5, 4, 7, 5, 3, 1, 9, 3, 4]}, + data={"c": [0, 2, 4, 1, np.nan, 3, 1, 4, 1], "d": [5, 4, 7, 5, 3, 1, 9, 3, 4]}, index=[0, 0, 0, 1, 1, 1, 2, 2, 2], ) @@ -258,10 +258,10 @@ def test_dropna_inplace_nested(): def test_dropna_errors(): """Test that the various dropna exceptions trigger""" - base = NestedFrame(data={"a": [1, 2, 3], "b": [2, np.NaN, 6]}, index=[0, 1, 2]) + base = NestedFrame(data={"a": [1, 2, 3], "b": [2, np.nan, 6]}, index=[0, 1, 2]) nested = pd.DataFrame( - data={"c": [0, 2, 4, 1, np.NaN, 3, 1, 4, 1], "d": [5, 4, 7, 5, 3, 1, 9, 3, 4]}, + data={"c": [0, 2, 4, 1, np.nan, 3, 1, 4, 1], "d": [5, 4, 7, 5, 3, 1, 9, 3, 4]}, index=[0, 0, 0, 1, 1, 1, 2, 2, 2], ) diff --git a/tests/nested_pandas/series/test_accessor.py b/tests/nested_pandas/series/test_accessor.py index a9c5549..a4ac4db 100644 --- a/tests/nested_pandas/series/test_accessor.py +++ b/tests/nested_pandas/series/test_accessor.py @@ -805,7 +805,7 @@ def test_to_flat_dropna(): """ flat = pd.DataFrame( - data={"c": [0, 2, 4, 1, np.NaN, 3, 1, 4, 1], "d": [5, 4, 7, 5, 3, 1, 9, 3, 4]}, + data={"c": [0, 2, 4, 1, np.nan, 3, 1, 4, 1], "d": [5, 4, 7, 5, 3, 1, 9, 3, 4]}, index=[0, 0, 0, 1, 1, 1, 2, 2, 2], ) nested = pack_flat(flat, name="nested") diff --git a/tests/nested_pandas/utils/test_utils.py b/tests/nested_pandas/utils/test_utils.py index 43e4648..e1403a8 100644 --- a/tests/nested_pandas/utils/test_utils.py +++ b/tests/nested_pandas/utils/test_utils.py @@ -10,10 +10,10 @@ def test_count_nested(join): """Test the functionality of count nested""" # Initialize test data - base = NestedFrame(data={"a": [1, 2, 3], "b": [2, np.NaN, 6]}, index=[0, 1, 2]) + base = NestedFrame(data={"a": [1, 2, 3], "b": [2, np.nan, 6]}, index=[0, 1, 2]) nested = pd.DataFrame( data={ - "c": [0, 2, 4, 1, np.NaN, 3, 1, 4, 1], + "c": [0, 2, 4, 1, np.nan, 3, 1, 4, 1], "d": [5, 4, 7, 5, 3, 1, 9, 3, 4], "label": ["a", "a", "b", "b", "a", "a", "b", "a", "b"], },