Skip to content

Commit 8222c21

Browse files
committed
fixed some errors
1 parent ef9812e commit 8222c21

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

doc/source/whatsnew/v3.0.0.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,6 @@ ExtensionArray
864864
- Bug in constructing pandas data structures when passing into ``dtype`` a string of the type followed by ``[pyarrow]`` while PyArrow is not installed would raise ``NameError`` rather than ``ImportError`` (:issue:`57928`)
865865
- Bug in various :class:`DataFrame` reductions for pyarrow temporal dtypes returning incorrect dtype when result was null (:issue:`59234`)
866866

867-
868867
Styler
869868
^^^^^^
870869
- Bug in :meth:`Styler.to_latex` where styling column headers when combined with a hidden index or hidden index-levels is fixed.
Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
1-
import pandas as pd
2-
1+
from pandas import Series, NA, isna
2+
from pandas.testing import assert_series_equal
33

44
def test_basemaskedarray_map():
5-
for dtype, data, expected_data in [
6-
("Int32", [1, 2, None, 4], [2, 3, pd.NA, 5]),
7-
]:
8-
s = pd.Series(data, dtype=dtype)
5+
6+
s = Series([1, 2, None, 4], dtype="Int32")
97

108
def transform(x):
11-
if x is None:
9+
if isna(x):
1210
return x
1311
return x + 1
1412

1513
result = s.map(transform)
16-
expected = pd.Series(expected_data, dtype=result.dtype)
14+
expected = Series([2, 3, NA, 5], dtype=result.dtype)
1715

18-
assert result.tolist() == expected.tolist()
16+
assert_series_equal(result, expected)

pandas/tests/extension/test_masked.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def test_map_na_action_ignore(self, data_missing_for_sorting):
191191
if data_missing_for_sorting.dtype.kind == "b":
192192
expected = np.array([False, pd.NA, False], dtype=object)
193193
else:
194-
expected = np.array([zero, np.nan, zero])
194+
expected = np.array([zero, pd.NA, zero])
195195
for i in range(len(result)):
196196
if result[i] is pd.NA:
197197
result[i] = "nan"

0 commit comments

Comments
 (0)