Skip to content

Commit 0f2b03a

Browse files
committed
Remove unnecessary path
1 parent d9a5eb8 commit 0f2b03a

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
@@ -184,7 +184,7 @@ def __new__(cls, data=None, dtype=None, copy=False, name=None,
184184
from pandas.tseries.tdi import TimedeltaIndex
185185
result = TimedeltaIndex(data, copy=copy, name=name, **kwargs)
186186
if dtype is not None and _o_dtype == dtype:
187-
return result.asobject
187+
return Index(result.to_pytimedelta(), dtype=_o_dtype)
188188
else:
189189
return result
190190
elif is_period_dtype(data):
@@ -2327,7 +2327,6 @@ def get_indexer(self, target, method=None, limit=None, tolerance=None):
23272327
tolerance = self._convert_tolerance(tolerance)
23282328

23292329
pself, ptarget = self._possibly_promote(target)
2330-
23312330
if pself is not self or ptarget is not target:
23322331
return pself.get_indexer(ptarget, method=method, limit=limit,
23332332
tolerance=tolerance)
@@ -2353,6 +2352,7 @@ def get_indexer(self, target, method=None, limit=None, tolerance=None):
23532352
if limit is not None:
23542353
raise ValueError('limit argument only valid if doing pad, '
23552354
'backfill or nearest reindexing')
2355+
23562356
indexer = self._engine.get_indexer(target._values)
23572357

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