@@ -91,7 +91,7 @@ def read_csv(filepath_or_buffer, sep=',', header=0, index_col=None, names=None,
91
91
skiprows = None , na_values = None , parse_dates = False ,
92
92
date_parser = None , nrows = None , iterator = False , chunksize = None ,
93
93
skip_footer = 0 , converters = None , verbose = False , delimiter = None ,
94
- encoding = None , infer_index = True ):
94
+ encoding = None ):
95
95
if hasattr (filepath_or_buffer , 'read' ):
96
96
f = filepath_or_buffer
97
97
else :
@@ -117,8 +117,7 @@ def read_csv(filepath_or_buffer, sep=',', header=0, index_col=None, names=None,
117
117
skip_footer = skip_footer ,
118
118
converters = converters ,
119
119
verbose = verbose ,
120
- encoding = encoding ,
121
- infer_index = infer_index )
120
+ encoding = encoding )
122
121
123
122
if nrows is not None :
124
123
return parser .get_chunk (nrows )
@@ -205,8 +204,6 @@ class TextParser(object):
205
204
Number of line at bottom of file to skip
206
205
encoding : string, default None
207
206
Encoding to use for UTF when reading/writing (ex. 'utf-8')
208
- infer_index : boolean, default True
209
- If index_col is None, will try to infer index unless this is False
210
207
"""
211
208
212
209
# common NA values
@@ -220,7 +217,7 @@ def __init__(self, f, delimiter=None, names=None, header=0,
220
217
index_col = None , na_values = None , parse_dates = False ,
221
218
date_parser = None , chunksize = None , skiprows = None ,
222
219
skip_footer = 0 , converters = None , verbose = False ,
223
- encoding = None , infer_index = True ):
220
+ encoding = None ):
224
221
"""
225
222
Workhorse function for processing nested list into DataFrame
226
223
@@ -237,7 +234,7 @@ def __init__(self, f, delimiter=None, names=None, header=0,
237
234
self .chunksize = chunksize
238
235
self .passed_names = names is not None
239
236
self .encoding = encoding
240
- self . infer_index = infer_index
237
+
241
238
242
239
if com .is_integer (skiprows ):
243
240
skiprows = range (skiprows )
@@ -404,7 +401,7 @@ def _get_index_name(self):
404
401
return line
405
402
406
403
if implicit_first_cols > 0 :
407
- if self .index_col is None and self . infer_index :
404
+ if self .index_col is None :
408
405
if implicit_first_cols == 1 :
409
406
self .index_col = 0
410
407
else :
@@ -485,7 +482,8 @@ def get_chunk(self, rows=None):
485
482
486
483
if not index ._verify_integrity ():
487
484
dups = index .get_duplicates ()
488
- raise Exception ('Index has duplicates: %s' % str (dups ))
485
+ err_msg = 'Tried columns 1-X as index but found duplicates %s'
486
+ raise Exception (err_msg % str (dups ))
489
487
490
488
if len (self .columns ) != len (zipped_content ):
491
489
raise Exception ('wrong number of columns' )
0 commit comments