Skip to content

Commit e57c684

Browse files
committed
Remove unnecessary path
1 parent 07d614c commit e57c684

File tree

3 files changed

+4
-19
lines changed

3 files changed

+4
-19
lines changed

pandas/core/internals.py

+2-16
Original file line numberDiff line numberDiff line change
@@ -1178,7 +1178,7 @@ def handle_error(detail):
11781178

11791179
# technically a broadcast error in numpy can 'work' by returning a
11801180
# boolean False
1181-
if not isinstance(result, (np.ndarray, PeriodIndex)):
1181+
if not isinstance(result, np.ndarray):
11821182
# differentiate between an invalid ndarray-ndarray comparison
11831183
# and an invalid type comparison
11841184
if isinstance(values, np.ndarray) and is_list_like(other):
@@ -1843,7 +1843,7 @@ def convert(self, *args, **kwargs):
18431843
raise NotImplementedError
18441844
by_item = True if 'by_item' not in kwargs else kwargs['by_item']
18451845

1846-
new_inputs = ['coerce', 'datetime', 'numeric', 'timedelta', 'period']
1846+
new_inputs = ['coerce', 'datetime', 'numeric', 'timedelta']
18471847
new_style = False
18481848
for kw in new_inputs:
18491849
new_style |= kw in kwargs
@@ -2532,7 +2532,6 @@ def __init__(self, values, placement, ndim=2, **kwargs):
25322532
dtype = kwargs.pop('dtype', None)
25332533
if not isinstance(values, self._holder):
25342534
# dtype contains freq info
2535-
print(values, dtype)
25362535
values = self._holder(values, dtype=dtype)
25372536

25382537
super(PeriodBlock, self).__init__(values, placement=placement,
@@ -2563,19 +2562,6 @@ def to_dense(self):
25632562
# called from Series.get_values()
25642563
return self.values.asobject
25652564

2566-
# def _try_fill(self, value):
2567-
# """ if we are a NaT, return the actual fill value """
2568-
# if value is tslib.NaT or np.array(isnull(value)).all():
2569-
# value = tslib.iNaT
2570-
# elif isinstance(value, Period):
2571-
# # Period Nat can be handled here
2572-
# value = value.ordinal
2573-
# elif is_integer(value):
2574-
# # regarded as ordinal
2575-
# pass
2576-
#
2577-
# return value
2578-
25792565
def _try_coerce_args(self, values, other):
25802566
"""
25812567
Coerce values and other to dtype 'i8'. NaN and NaT convert to

pandas/indexes/base.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def __new__(cls, data=None, dtype=None, copy=False, name=None,
182182
from pandas.tseries.tdi import TimedeltaIndex
183183
result = TimedeltaIndex(data, copy=copy, name=name, **kwargs)
184184
if dtype is not None and _o_dtype == dtype:
185-
return result.asobject
185+
return Index(result.to_pytimedelta(), dtype=_o_dtype)
186186
else:
187187
return result
188188
elif is_period_dtype(data):
@@ -2266,7 +2266,6 @@ def get_indexer(self, target, method=None, limit=None, tolerance=None):
22662266
tolerance = self._convert_tolerance(tolerance)
22672267

22682268
pself, ptarget = self._possibly_promote(target)
2269-
22702269
if pself is not self or ptarget is not target:
22712270
return pself.get_indexer(ptarget, method=method, limit=limit,
22722271
tolerance=tolerance)
@@ -2292,6 +2291,7 @@ def get_indexer(self, target, method=None, limit=None, tolerance=None):
22922291
if limit is not None:
22932292
raise ValueError('limit argument only valid if doing pad, '
22942293
'backfill or nearest reindexing')
2294+
22952295
indexer = self._engine.get_indexer(target._values)
22962296

22972297
return _ensure_platform_int(indexer)

pandas/io/pytables.py

-1
Original file line numberDiff line numberDiff line change
@@ -2037,7 +2037,6 @@ def get_atom_period(self, block):
20372037
return _tables().Int64Col(shape=block.shape[0])
20382038

20392039
def set_atom_period(self, block, info, values=None):
2040-
print('set_atom_period')
20412040
if values is None:
20422041
values = block.values
20432042
values = values.asi8.reshape(block.shape)

0 commit comments

Comments
 (0)