We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
dtype
str.decode
1 parent 9d05d4b commit 9562158Copy full SHA for 9562158
pandas/tests/strings/test_strings.py
@@ -11,6 +11,7 @@
11
Index,
12
MultiIndex,
13
Series,
14
+ option_context,
15
)
16
import pandas._testing as tm
17
from pandas.core.strings.accessor import StringMethods
@@ -778,3 +779,11 @@ def test_series_str_decode():
778
779
result = Series([b"x", b"y"]).str.decode(encoding="UTF-8", errors="strict")
780
expected = Series(["x", "y"], dtype="str")
781
tm.assert_series_equal(result, expected)
782
+
783
784
+def test_decode_with_dtype_none():
785
+ with option_context("future.infer_string", True):
786
+ ser = Series([b"a", b"b", b"c"])
787
+ result = ser.str.decode("utf-8", dtype=None)
788
+ expected = Series(["a", "b", "c"], dtype="str")
789
+ tm.assert_series_equal(result, expected)
0 commit comments