Upload hf_env/lib/python3.14/site-packages/pandas/tests/arrays/integer/test_indexing.py with huggingface_hub
Browse files
hf_env/lib/python3.14/site-packages/pandas/tests/arrays/integer/test_indexing.py
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import pandas as pd
|
| 2 |
+
import pandas._testing as tm
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
def test_array_setitem_nullable_boolean_mask():
|
| 6 |
+
# GH 31446
|
| 7 |
+
ser = pd.Series([1, 2], dtype="Int64")
|
| 8 |
+
result = ser.where(ser > 1)
|
| 9 |
+
expected = pd.Series([pd.NA, 2], dtype="Int64")
|
| 10 |
+
tm.assert_series_equal(result, expected)
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
def test_array_setitem():
|
| 14 |
+
# GH 31446
|
| 15 |
+
arr = pd.array([1, 2], dtype="Int64")
|
| 16 |
+
arr[arr > 1] = 1
|
| 17 |
+
|
| 18 |
+
expected = pd.array([1, 1], dtype="Int64")
|
| 19 |
+
tm.assert_extension_array_equal(arr, expected)
|