From 7035c0ac4758ac5a47d6053a2a90a5c9108bbd2a Mon Sep 17 00:00:00 2001 From: Konstantin Malanchev Date: Mon, 17 Jun 2024 08:42:54 -0400 Subject: [PATCH] np.NaN -> np.nan --- .../nestedframe/test_nestedframe.py | 16 ++++++++-------- tests/nested_pandas/series/test_accessor.py | 2 +- tests/nested_pandas/utils/test_utils.py | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) 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"], },