Skip to content

Commit 371d491

Browse files
committed
Remove unnecessary path
1 parent 136ab42 commit 371d491

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
@@ -1192,7 +1192,7 @@ def handle_error(detail):
11921192

11931193
# technically a broadcast error in numpy can 'work' by returning a
11941194
# boolean False
1195-
if not isinstance(result, (np.ndarray, PeriodIndex)):
1195+
if not isinstance(result, np.ndarray):
11961196
# differentiate between an invalid ndarray-ndarray comparison
11971197
# and an invalid type comparison
11981198
if isinstance(values, np.ndarray) and is_list_like(other):
@@ -1860,7 +1860,7 @@ def convert(self, *args, **kwargs):
18601860
raise NotImplementedError
18611861
by_item = True if 'by_item' not in kwargs else kwargs['by_item']
18621862

1863-
new_inputs = ['coerce', 'datetime', 'numeric', 'timedelta', 'period']
1863+
new_inputs = ['coerce', 'datetime', 'numeric', 'timedelta']
18641864
new_style = False
18651865
for kw in new_inputs:
18661866
new_style |= kw in kwargs
@@ -2552,7 +2552,6 @@ def __init__(self, values, placement, ndim=2, **kwargs):
25522552
dtype = kwargs.pop('dtype', None)
25532553
if not isinstance(values, self._holder):
25542554
# dtype contains freq info
2555-
print(values, dtype)
25562555
values = self._holder(values, dtype=dtype)
25572556

25582557
super(PeriodBlock, self).__init__(values, placement=placement,
@@ -2583,19 +2582,6 @@ def to_dense(self):
25832582
# called from Series.get_values()
25842583
return self.values.asobject
25852584

2586-
# def _try_fill(self, value):
2587-
# """ if we are a NaT, return the actual fill value """
2588-
# if value is tslib.NaT or np.array(isnull(value)).all():
2589-
# value = tslib.iNaT
2590-
# elif isinstance(value, Period):
2591-
# # Period Nat can be handled here
2592-
# value = value.ordinal
2593-
# elif is_integer(value):
2594-
# # regarded as ordinal
2595-
# pass
2596-
#
2597-
# return value
2598-
25992585
def _try_coerce_args(self, values, other):
26002586
"""
26012587
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):
@@ -2273,7 +2273,6 @@ def get_indexer(self, target, method=None, limit=None, tolerance=None):
22732273
tolerance = self._convert_tolerance(tolerance)
22742274

22752275
pself, ptarget = self._possibly_promote(target)
2276-
22772276
if pself is not self or ptarget is not target:
22782277
return pself.get_indexer(ptarget, method=method, limit=limit,
22792278
tolerance=tolerance)
@@ -2299,6 +2298,7 @@ def get_indexer(self, target, method=None, limit=None, tolerance=None):
22992298
if limit is not None:
23002299
raise ValueError('limit argument only valid if doing pad, '
23012300
'backfill or nearest reindexing')
2301+
23022302
indexer = self._engine.get_indexer(target._values)
23032303

23042304
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)