Skip to content

Commit 1f82496

Browse files
committed
CLN: remove factorize argument
1 parent 4881213 commit 1f82496

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

pandas/io/parsers.py

+4-8
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22
Module contains tools for processing files into DataFrames or other objects
33
"""
44
from __future__ import print_function
5-
from pandas.compat import range, lrange, StringIO, lzip, zip, string_types
5+
from pandas.compat import range, lrange, StringIO, lzip, zip, string_types, map
66
from pandas import compat
77
import re
88
import csv
9-
from warnings import warn
109

1110
import numpy as np
1211

@@ -266,7 +265,6 @@ def _read(filepath_or_buffer, kwds):
266265
'buffer_lines': None,
267266
'error_bad_lines': True,
268267
'warn_bad_lines': True,
269-
'factorize': True,
270268
'dtype': None,
271269
'decimal': b'.'
272270
}
@@ -340,8 +338,7 @@ def parser_f(filepath_or_buffer,
340338
encoding=None,
341339
squeeze=False,
342340
mangle_dupe_cols=True,
343-
tupleize_cols=False,
344-
factorize=True):
341+
tupleize_cols=False):
345342

346343
# Alias sep -> delimiter.
347344
if delimiter is None:
@@ -400,8 +397,7 @@ def parser_f(filepath_or_buffer,
400397
low_memory=low_memory,
401398
buffer_lines=buffer_lines,
402399
mangle_dupe_cols=mangle_dupe_cols,
403-
tupleize_cols=tupleize_cols,
404-
factorize=factorize)
400+
tupleize_cols=tupleize_cols)
405401

406402
return _read(filepath_or_buffer, kwds)
407403

@@ -680,7 +676,7 @@ def __init__(self, kwds):
680676
is_sequence = isinstance(self.index_col, (list, tuple,
681677
np.ndarray))
682678
if not (is_sequence and
683-
all(com.is_integer(i) for i in self.index_col) or
679+
all(map(com.is_integer, self.index_col)) or
684680
com.is_integer(self.index_col)):
685681
raise ValueError("index_col must only contain row numbers "
686682
"when specifying a multi-index header")

pandas/parser.pyx

+1-4
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ cdef class TextReader:
237237
cdef:
238238
parser_t *parser
239239
object file_handle, na_fvalues
240-
bint factorize, na_filter, verbose, has_usecols, has_mi_columns
240+
bint na_filter, verbose, has_usecols, has_mi_columns
241241
int parser_start
242242
list clocks
243243
char *c_encoding
@@ -276,7 +276,6 @@ cdef class TextReader:
276276

277277
converters=None,
278278

279-
factorize=True,
280279
as_recarray=False,
281280

282281
skipinitialspace=False,
@@ -338,8 +337,6 @@ cdef class TextReader:
338337
raise ValueError('only length-1 separators excluded right now')
339338
self.parser.delimiter = ord(delimiter)
340339

341-
self.factorize = factorize
342-
343340
#----------------------------------------
344341
# parser options
345342

0 commit comments

Comments
 (0)