@@ -440,7 +440,7 @@ def _get_take_nd_function(ndim, arr_dtype, out_dtype, axis=0, mask_info=None):
440
440
if func is not None :
441
441
func = _convert_wrapper (func , out_dtype )
442
442
return func
443
-
443
+
444
444
def func (arr , indexer , out , fill_value = np .nan ):
445
445
_take_nd_generic (arr , indexer , out , axis = axis ,
446
446
fill_value = fill_value , mask_info = mask_info )
@@ -695,7 +695,7 @@ def _maybe_promote(dtype, fill_value=np.nan):
695
695
except :
696
696
# the proper thing to do here would probably be to upcast to
697
697
# object (but numpy 1.6.1 doesn't do this properly)
698
- fill_value = tslib .iNaT
698
+ fill_value = tslib .iNaT
699
699
elif is_float (fill_value ):
700
700
if issubclass (dtype .type , np .bool_ ):
701
701
dtype = np .object_
@@ -895,7 +895,7 @@ def _possibly_convert_objects(values, convert_dates=True, convert_numeric=True):
895
895
if convert_numeric and values .dtype == np .object_ :
896
896
try :
897
897
new_values = lib .maybe_convert_numeric (values ,set (),coerce_numeric = True )
898
-
898
+
899
899
# if we are all nans then leave me alone
900
900
if not isnull (new_values ).all ():
901
901
values = new_values
@@ -1154,7 +1154,7 @@ def _long_prod(vals):
1154
1154
result *= x
1155
1155
return result
1156
1156
1157
-
1157
+
1158
1158
class groupby (dict ):
1159
1159
"""
1160
1160
A simple groupby different from the one in itertools.
@@ -1343,6 +1343,7 @@ def is_list_like(arg):
1343
1343
def _is_sequence (x ):
1344
1344
try :
1345
1345
iter (x )
1346
+ len (x ) # it has a length
1346
1347
return not isinstance (x , basestring ) and True
1347
1348
except Exception :
1348
1349
return False
@@ -1647,7 +1648,8 @@ def _pprint_seq(seq, _nest_lvl=0, **kwds):
1647
1648
rather then calling this directly.
1648
1649
"""
1649
1650
fmt = u"[%s]" if hasattr (seq , '__setitem__' ) else u"(%s)"
1650
- return fmt % ", " .join (pprint_thing (e , _nest_lvl + 1 , ** kwds ) for e in seq )
1651
+ return fmt % ", " .join (pprint_thing (e , _nest_lvl + 1 , ** kwds )
1652
+ for e in seq [:len (seq )])
1651
1653
1652
1654
1653
1655
def _pprint_dict (seq , _nest_lvl = 0 ):
0 commit comments