@@ -49,11 +49,11 @@ def test_to_csv_deprecation(self, arg, datetime_series):
49
49
# see gh-19715
50
50
with ensure_clean () as path :
51
51
if arg == "path" :
52
- kwargs = dict (path = path , header = False , index_label = False )
52
+ kwargs = dict (path = path , header = False )
53
53
elif arg == "header" :
54
- kwargs = dict (path_or_buf = path , index_label = False )
54
+ kwargs = dict (path_or_buf = path )
55
55
else : # Both discrepancies match.
56
- kwargs = dict (path = path , index_label = False )
56
+ kwargs = dict (path = path )
57
57
58
58
with tm .assert_produces_warning (FutureWarning ):
59
59
datetime_series .to_csv (** kwargs )
@@ -65,7 +65,7 @@ def test_to_csv_deprecation(self, arg, datetime_series):
65
65
def test_from_csv (self , datetime_series , string_series ):
66
66
67
67
with ensure_clean () as path :
68
- datetime_series .to_csv (path , header = False , index_label = False )
68
+ datetime_series .to_csv (path , header = False )
69
69
ts = self .read_csv (path )
70
70
assert_series_equal (datetime_series , ts , check_names = False )
71
71
@@ -82,7 +82,7 @@ def test_from_csv(self, datetime_series, string_series):
82
82
ts_h = self .read_csv (path , header = 0 )
83
83
assert ts_h .name == "ts"
84
84
85
- string_series .to_csv (path , header = False , index_label = False )
85
+ string_series .to_csv (path , header = False )
86
86
series = self .read_csv (path )
87
87
assert_series_equal (string_series , series , check_names = False )
88
88
@@ -109,22 +109,21 @@ def test_to_csv(self, datetime_series):
109
109
import io
110
110
111
111
with ensure_clean () as path :
112
- datetime_series .to_csv (path , header = False , index_label = False )
112
+ datetime_series .to_csv (path , header = False )
113
113
114
114
with io .open (path , newline = None ) as f :
115
115
lines = f .readlines ()
116
116
assert (lines [1 ] != '\n ' )
117
117
118
- datetime_series .to_csv (path , index = False , header = False ,
119
- index_label = False )
118
+ datetime_series .to_csv (path , index = False , header = False )
120
119
arr = np .loadtxt (path )
121
120
assert_almost_equal (arr , datetime_series .values )
122
121
123
122
def test_to_csv_unicode_index (self ):
124
123
buf = StringIO ()
125
124
s = Series ([u ("\u05d0 " ), "d2" ], index = [u ("\u05d0 " ), u ("\u05d1 " )])
126
125
127
- s .to_csv (buf , encoding = "UTF-8" , header = False , index_label = False )
126
+ s .to_csv (buf , encoding = "UTF-8" , header = False )
128
127
buf .seek (0 )
129
128
130
129
s2 = self .read_csv (buf , index_col = 0 , encoding = "UTF-8" )
@@ -134,8 +133,7 @@ def test_to_csv_float_format(self):
134
133
135
134
with ensure_clean () as filename :
136
135
ser = Series ([0.123456 , 0.234567 , 0.567567 ])
137
- ser .to_csv (filename , float_format = "%.2f" , header = False ,
138
- index_label = False )
136
+ ser .to_csv (filename , float_format = "%.2f" , header = False )
139
137
140
138
rs = self .read_csv (filename )
141
139
xp = Series ([0.12 , 0.23 , 0.57 ])
@@ -154,7 +152,7 @@ def test_to_csv_path_is_none(self):
154
152
# Series.to_csv() was returning None, inconsistent with
155
153
# DataFrame.to_csv() which returned string
156
154
s = Series ([1 , 2 , 3 ])
157
- csv_str = s .to_csv (path_or_buf = None , header = False , index_label = False )
155
+ csv_str = s .to_csv (path_or_buf = None , header = False )
158
156
assert isinstance (csv_str , str )
159
157
160
158
@pytest .mark .parametrize ('s,encoding' , [
0 commit comments