Skip to content

Conversation

@fangchenli
Copy link
Member

No description provided.

@fangchenli
Copy link
Member Author

=================================== FAILURES ===================================
______________________________ test_where_dt64_2d ______________________________
[gw1] linux -- Python 3.8.0 /usr/share/miniconda/envs/pandas-dev/bin/python
    def test_where_dt64_2d():
        dti = date_range("2016-01-01", periods=6)
        dta = dti._data.reshape(3, 2)
        other = dta - dta[0, 0]
        df = DataFrame(dta, columns=["A", "B"])
        mask = np.asarray(df.isna())
        mask[:, 1] = True
        # setting all of one column, none of the other
        expected = DataFrame({"A": other[:, 0], "B": dta[:, 1]})
>       _check_where_equivalences(df, mask, other, expected)
pandas/tests/frame/indexing/test_where.py:1019: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
df =            A          B
0 2016-01-01 2016-01-02
1 2016-01-03 2016-01-04
2 2016-01-05 2016-01-06
mask = array([[False,  True],
       [False,  True],
       [False,  True]])
other = <TimedeltaArray>
[
['0 days', '1 days'],
['2 days', '3 days'],
['4 days', '5 days']
]
Shape: (3, 2), dtype: timedelta[64](https://github.com/pandas-dev/pandas/runs/6739385945?check_suite_focus=true#step:9:65)[ns]
expected =        A          B
0 0 days 2016-01-02
1 2 days 2016-01-04
2 4 days 2016-01-06
    def _check_where_equivalences(df, mask, other, expected):
        # similar to tests.series.indexing.test_setitem.SetitemCastingEquivalences
        #  but with DataFrame in mind and less fleshed-out
        res = df.where(mask, other)
>       tm.assert_frame_equal(res, expected)
E       AssertionError: Attributes of DataFrame.iloc[:, 0] (column name="A") are different
E       
E       Attribute "dtype" are different
E       [left]:  int64
E       [right]: timedelta64[ns]
pandas/tests/frame/indexing/test_where.py:990: AssertionError

@jreback jreback added this to the 1.5 milestone Jun 5, 2022
@jreback jreback added the Dependencies Required and optional dependencies label Jun 5, 2022
@jreback jreback merged commit 07c46df into pandas-dev:main Jun 5, 2022
@jreback
Copy link
Contributor

jreback commented Jun 5, 2022

thanks @fangchenli

I wouldn't mind actually bumping to 1.20+ per: https://numpy.org/neps/nep-0029-deprecation_policy.html

but no big deal to keep here as well.

@fangchenli fangchenli deleted the drop-np18 branch June 7, 2022 03:53
yehoshuadimarsky pushed a commit to yehoshuadimarsky/pandas that referenced this pull request Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Dependencies Required and optional dependencies

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants