-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DataFrame vs Series vs Index arithmetic Roundup #18824
Comments
I was asked to comment here about issue #20088. Issue #20088 is closest in spirit to #8554, in the sense that both bugs involve arithmetic operations (subtraction and division, respectively) for dataframes containing timedelta values. That said, the bugs are somewhat distinct... paraphrasing, #8554 is roughly this: DataFrame[date] - date should give timedeltas, whereas #20088 is roughly this: DataFrame[timedelta64] / timedelta64 should give float. I suggest you re-open #20088 and add it to the list of "DataFrame" issues above. |
none of the issues here need to be reopened this is a master tracking issue and they are referenced |
Down to 3 checkboxes, none of which are actionable. Closing. |
Categorical:
Series-specific:
__rdivmod__
(closed by Implement Series.__rdivmod__, un-xfail tests #23271)DataFrame
pd.DataFrame([pd.NaT]).eq(pd.NaT)
returnsNaN
instead of bool.==
is OK. (closed by dispatch scalar DataFrame ops to Series #22163)DataFrame.__eq__
is raising instead of returning bool (closed by dispatch scalar DataFrame ops to Series #22163)DataFrame.sub
broadcasting problem (closed by (I think) dispatch scalar DataFrame ops to Series #22163)DataFrame[datetime64] - datetime
is returningDataFrame[datetime64]
instead ofDataFrame[timedelta64]
(closed by dispatch scalar DataFrame ops to Series #22163)pd.Timestamp('2000-01-01') > pd.DataFrame({'x': range(5)})
returns 5 Trues instead of raising (closed by dispatch scalar DataFrame ops to Series #22163)DataFrame[datetime64] != pd.Series([pd.NaT])
raises (closed by (I think) dispatch scalar DataFrame ops to Series #22163)DataFrame[timedelta64] / timedeltalike
(closed by dispatch scalar DataFrame ops to Series #22163)Bool/Bitwise Methods:
Unsorted:
TimedeltaIndex
vsSeries[timedelta64]
Series[timedelta64] // timedelta
raisesTypeError
. See others in BUG: fix Series[timedelta64] arithmetic with Timedelta scalars #18831. (Closed by BUG: fix Series[timedelta64] arithmetic with Timedelta scalars #18831)Series[timedelta64]
+/-TimedeltaIndex
gets cast to int64 BUG:: Series of timedelta + TimedeltaIndex gets casted to int64 #17250. Update: This appears to affect 0.22.0 but no longer affect master as of 2018-01-02. Needs a test. (closed by Tests for TDI issues already fixed #19044)pd.Timedelta('3 hours') / pd.Series([pd.Timedelta('1 day')])
returns0 days
, not0.125
(closed by BUG: fix Series[timedelta64] arithmetic with Timedelta scalars #18831)TimedeltaIndex * Series[int]
returnsTimedeltaIndex
Index * Series returns Index #19042 (closed by Fix Index mul/div ops with Series, closes #19080, #19042 #19253)Series[timedelta64] + TimedeltaIndex
inherits name from the latter. This does not occur in 0.22.0, occurs in master as of 2018-01-02. Series[timedelta64] +/- TimedeltaIndex inherits name from TimedeltaIndex #19043 (closed by Tests for TDI issues already fixed #19044)No original issue, no longer re-producable.TimedeltaIndex + Series[timedelta64]
raises ValueError (TODO: issue?) (Fixed by Fix Series[timedelta64]+DatetimeIndex[tz] bugs #18884 but needs test)TimedeltaIndex + Series[offsets]
gets transposed and returns Series of TimedeltaIndexes. Analogue to BUG: DatetimeIndex + arraylike of DateOffsets #18849 (closed by Fix Series[timedelta64]+DatetimeIndex[tz] bugs #18884 (I think))TimedeltaIndex
+/- zero-dimensional integer arrays DatetimeIndex/TimedeltaIndex add/sub zero-dim arrays incorrect #19012 (closed by datetimelike indexes add/sub zero-dim integer arrays #19013)DatetimeIndex
vsSeries[datetime64]
Series.__sub__
incorrect with non-nano datetime64 BUG: coercion of non-M8[ns] in datetime ops #7996 (closed by Fix Series.__sub__ non-nano datetime64 #18783)Series[datetime64] - pd.NaT
returns datetime64-dtype,DatetimeIndex - pd.NaT
returns timedelta64-dtype. Series.__sub__(NaT) vs DatetimeIndex.__sub__(NaT) #18808, diff of datetime column with NaT does not result into TimeDelta #17837. (closed by dispatch Series[datetime64] ops to DatetimeIndex #19024)Series
+/-Series[offsets]
applies element-wise.DatetimeIndex
+/-box([offsets])
raises forbox in [np.array, pd.Index]
and forbox == Series
returns aSeries
ofDatetimeIndex
objects. (Closed by BUG: DatetimeIndex + arraylike of DateOffsets #18849)Series[datetime64tz] - DatetimeIndex[tz]
(with same tz) raises, same with reverse op Series[datetime64tz] - DatetimeIndex[tz] raises ValueError #19071. (Fixed by Fix Series[timedelta64]+DatetimeIndex[tz] bugs #18884 but needs test) (closed by Tests for fixed issues in Series[datetime64] #19072)DatetimeIndex[tz] + Series[timedelta64]
returnsDatetimeIndex
(?). Example from DatetimeIndex + TimeDelta gives wrong results when timezone is set #13905 but the behavior seems to have changed since then. As of late-Dec 2017 behavior is as in DatetimeIndex + Series[timedelta64] returns DatetimeIndex #18963. (Closed by Fix Series[timedelta64]+DatetimeIndex[tz] bugs #18884)Series
is missing overflow checks Negative timedeltas for deltas > 292 years #12534 (Note: this is not specific to datetime/timedelta. Even int64 is missing overflow checks) (closed by Tests for fixed issues in Series[datetime64] #19072 (but only for datetime dtypes)Series[datetime64] - PeriodIndex
is allowed,DatetimeIndex - PeriodIndex
is not. Series[datetime64] - PeriodIndex vs DatetimeIndex - PeriodIndex #18850. (closed by dispatch Series[datetime64] ops to DatetimeIndex #19024)DatetimeIndex
+/- zero-dimensional integer arrays DatetimeIndex/TimedeltaIndex add/sub zero-dim arrays incorrect #19012 (closed by datetimelike indexes add/sub zero-dim integer arrays #19013)Timedelta
(strictly speaking out of scope)pd.Timedelta(minutes=5, seconds=4) // np.timedelta64('NaT')
--> -1 instead ofNaN
, also messes up fortimedelta / Series([Timedelta, NaT])
(closed by Fix Timedelta.__floordiv__, __rfloordiv__ #18961)The text was updated successfully, but these errors were encountered: