Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pandas/_libs/intervaltree.pxi.in
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ cdef class IntervalTree(IntervalMixin):

# TODO: write get_indexer_intervals
cdef:
size_t old_len
Py_ssize_t old_len
Py_ssize_t i
Int64Vector result

Expand All @@ -179,7 +179,7 @@ cdef class IntervalTree(IntervalMixin):
the given array of scalar targets. Non-unique positions are repeated.
"""
cdef:
size_t old_len
Py_ssize_t old_len
Py_ssize_t i
Int64Vector result, missing

Expand Down
5 changes: 3 additions & 2 deletions pandas/_libs/lib.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -2066,7 +2066,7 @@ def maybe_convert_objects(ndarray[object] objects, bint try_float=0,
floats[i] = float(val)
complexes[i] = complex(val)
seen.float_ = 1
except Exception:
except (ValueError, TypeError):
seen.object_ = 1
break
else:
Expand Down Expand Up @@ -2346,7 +2346,8 @@ def to_object_array_tuples(rows: object):
row = rows[i]
for j in range(len(row)):
result[i, j] = row[j]
except Exception:
except TypeError:
# e.g. "Expected tuple, got list"
# upcast any subclasses to tuple
for i in range(n):
row = (rows[i],) if checknull(rows[i]) else tuple(rows[i])
Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/tslibs/parsing.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ def try_parse_dates(object[:] values, parser=None,
else:
result[i] = parse_date(values[i])
except Exception:
# failed
# Since parser is user-defined, we can't guess what it migh raise
return values
else:
parse_date = parser
Expand Down
7 changes: 2 additions & 5 deletions pandas/_libs/tslibs/timezones.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,8 @@ cdef object get_dst_info(object tz):
if treat_tz_as_pytz(tz):
trans = np.array(tz._utc_transition_times, dtype='M8[ns]')
trans = trans.view('i8')
try:
if tz._utc_transition_times[0].year == 1:
trans[0] = NPY_NAT + 1
except Exception:
pass
if tz._utc_transition_times[0].year == 1:
trans[0] = NPY_NAT + 1
deltas = unbox_utcoffsets(tz._transition_info)
typ = 'pytz'

Expand Down