@@ -744,13 +744,13 @@ def test_to_csv_bytes(self):
744
744
# GH 9712
745
745
times = date_range ("2013-10-27 23:00" , "2013-10-28 00:00" , freq = "H" )
746
746
df = DataFrame (
747
- {b"hello " : [b"abcd " , b"world " ], b"times" : times }, index = [b"A" , b"B" ]
747
+ {b"foo " : [b"bar " , b"baz " ], b"times" : times }, index = [b"A" , b"B" ]
748
748
)
749
749
df .loc [b"C" ] = np .nan
750
750
df .index .name = b"idx"
751
751
752
752
df_expected = DataFrame (
753
- {"hello " : ["abcd " , "world " ], "times" : times }, index = ["A" , "B" ]
753
+ {"foo " : ["bar " , "baz " ], "times" : times }, index = ["A" , "B" ]
754
754
)
755
755
df_expected .loc ["C" ] = np .nan
756
756
df_expected .index .name = "idx"
@@ -763,10 +763,10 @@ def test_to_csv_bytes(self):
763
763
764
764
non_unicode_byte = b"\xbc \xa6 "
765
765
non_unicode_decoded = non_unicode_byte .decode ("gb18030" )
766
- df = DataFrame ({non_unicode_byte : [non_unicode_byte , b"world " ]})
766
+ df = DataFrame ({non_unicode_byte : [non_unicode_byte , b"foo " ]})
767
767
df .index .name = "idx"
768
768
769
- df_expected = DataFrame ({non_unicode_decoded : [non_unicode_decoded , "world " ]})
769
+ df_expected = DataFrame ({non_unicode_decoded : [non_unicode_decoded , "foo " ]})
770
770
df_expected .index .name = "idx"
771
771
772
772
with tm .ensure_clean ("__tmp_to_csv_bytes__.csv" ) as path :
@@ -779,13 +779,13 @@ def test_to_csv_bytes(self):
779
779
df .to_csv (bytes_encoding = "utf-8" )
780
780
781
781
# mixing of bytes and non-bytes
782
- df = DataFrame ({"hello " : [b"abcd " , "world " ]})
782
+ df = DataFrame ({"foo " : [b"bar " , "baz " ]})
783
783
with pytest .raises (ValueError ):
784
784
df .to_csv ()
785
- df = DataFrame ({b"hello " : ["a" , "b" ], "world " : ["c" , "d" ]})
785
+ df = DataFrame ({b"foo " : ["a" , "b" ], "bar " : ["c" , "d" ]})
786
786
with pytest .raises (ValueError ):
787
787
df .to_csv ()
788
- df = DataFrame ({"hello " : ["a" , "b" ], "world " : ["c" , "d" ]}, index = ["A" , b"B" ])
788
+ df = DataFrame ({"foo " : ["a" , "b" ], "bar " : ["c" , "d" ]}, index = ["A" , b"B" ])
789
789
with pytest .raises (ValueError ):
790
790
df .to_csv ()
791
791
0 commit comments