f2ff676169c6f2aca04eebe22e5d31501f8a2a6b,pandas/tests/indexing/test_coercion.py,TestWhereCoercion,test_where_index_timedelta64,#TestWhereCoercion#Any#,797
Before Change
result = tdi.where(cond, value)
tm.assert_index_equal(result, expected)
msg = "value should be a "Timedelta", "NaT", or array of thos"
with pytest.raises(TypeError, match=msg):
// wrong-dtyped NaT
tdi.where(cond, np.datetime64("NaT", "ns"))
def test_where_index_period(self):
dti = pd.date_range("2016-01-01", periods=3, freq="QS")
pi = dti.to_period("Q")
After Change
// wrong-dtyped NaT
dtnat = np.datetime64("NaT", "ns")
expected = pd.Index([tdi[0], dtnat, dtnat, tdi[3]], dtype=object)
assert expected[1] is dtnat
result = tdi.where(cond, dtnat)
tm.assert_index_equal(result, expected)
In pattern: SUPERPATTERN
Frequency: 5
Non-data size: 5
Instances
Project Name: pandas-dev/pandas
Commit Name: f2ff676169c6f2aca04eebe22e5d31501f8a2a6b
Time: 2021-02-10
Author: jbrockmendel@gmail.com
File Name: pandas/tests/indexing/test_coercion.py
Class Name: TestWhereCoercion
Method Name: test_where_index_timedelta64
Project Name: pandas-dev/pandas
Commit Name: f2ff676169c6f2aca04eebe22e5d31501f8a2a6b
Time: 2021-02-10
Author: jbrockmendel@gmail.com
File Name: pandas/tests/indexing/test_coercion.py
Class Name: TestWhereCoercion
Method Name: test_where_index_period
Project Name: pandas-dev/pandas
Commit Name: f2ff676169c6f2aca04eebe22e5d31501f8a2a6b
Time: 2021-02-10
Author: jbrockmendel@gmail.com
File Name: pandas/tests/indexes/datetimes/test_indexing.py
Class Name: TestWhere
Method Name: test_where_mismatched_nat
Project Name: pandas-dev/pandas
Commit Name: f2ff676169c6f2aca04eebe22e5d31501f8a2a6b
Time: 2021-02-10
Author: jbrockmendel@gmail.com
File Name: pandas/tests/indexes/timedeltas/test_indexing.py
Class Name: TestWhere
Method Name: test_where_mismatched_nat
Project Name: pandas-dev/pandas
Commit Name: f2ff676169c6f2aca04eebe22e5d31501f8a2a6b
Time: 2021-02-10
Author: jbrockmendel@gmail.com
File Name: pandas/tests/indexes/period/test_indexing.py
Class Name: TestWhere
Method Name: test_where_mismatched_nat