File tree 2 files changed +11
-1
lines changed
2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -1608,7 +1608,7 @@ def construct_1d_ndarray_preserving_na(
1608
1608
"""
1609
1609
subarr = np .array (values , dtype = dtype , copy = copy )
1610
1610
1611
- if dtype is not None and dtype .kind in ( "U" , "S" ) :
1611
+ if dtype is not None and dtype .kind == "U" :
1612
1612
# GH-21083
1613
1613
# We can't just return np.array(subarr, dtype='str') since
1614
1614
# NumPy will convert the non-string objects into strings
Original file line number Diff line number Diff line change @@ -785,6 +785,16 @@ def non_reducing_function(val):
785
785
df .applymap (func )
786
786
assert values == df .a .to_list ()
787
787
788
+ < << << << HEAD
789
+ == == == =
790
+ def test_apply_with_byte_string (self ):
791
+ # GH 34529
792
+ try :
793
+ df = pd .DataFrame (np .array ([b'abcd' , b'efgh' ]), columns = ['col' ])
794
+ df .apply (lambda x : x .astype ('object' ))
795
+ except OSError as err :
796
+ tm .external_error_raised (err )
797
+ >> >> >> > 3 cc40f2cf ... correction on test for issue - #34529
788
798
789
799
class TestInferOutputShape :
790
800
# the user has supplied an opaque UDF where
You can’t perform that action at this time.
0 commit comments