diff --git a/pandas/core/arrays/datetimelike.py b/pandas/core/arrays/datetimelike.py index 8b6f49cc7d589..2a8cf502de53b 100644 --- a/pandas/core/arrays/datetimelike.py +++ b/pandas/core/arrays/datetimelike.py @@ -1192,7 +1192,7 @@ def _add_timedelta_arraylike(self, other): self_i8, other_i8, arr_mask=self._isnan, b_mask=other._isnan ) if self._hasnans or other._hasnans: - mask = (self._isnan) | (other._isnan) + mask = self._isnan | other._isnan new_values[mask] = iNaT return type(self)(new_values, dtype=self.dtype) diff --git a/pandas/core/arrays/datetimes.py b/pandas/core/arrays/datetimes.py index db73c84b39cf9..1e879e32bed5f 100644 --- a/pandas/core/arrays/datetimes.py +++ b/pandas/core/arrays/datetimes.py @@ -2010,6 +2010,7 @@ def objects_to_datetime64ns( utc : bool, default False Whether to convert timezone-aware timestamps to UTC. errors : {'raise', 'ignore', 'coerce'} + require_iso8601 : bool, default False allow_object : bool Whether to return an object-dtype ndarray instead of raising if the data contains more than one timezone. diff --git a/pandas/core/arrays/period.py b/pandas/core/arrays/period.py index 15f2842e39875..ed45b4da7279e 100644 --- a/pandas/core/arrays/period.py +++ b/pandas/core/arrays/period.py @@ -648,7 +648,7 @@ def _sub_period_array(self, other): new_values = np.array([self.freq.base * x for x in new_values]) if self._hasnans or other._hasnans: - mask = (self._isnan) | (other._isnan) + mask = self._isnan | other._isnan new_values[mask] = NaT return new_values