You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In [2]: df = pd.DataFrame(data=[[0, 2, 1], [np.nan, 5, 4]], index=pd.date_range('2014-01-01', '2014-01-2', name='timestamp'), columns=pd.MultiIndex.from_product([['value'], [24, 3766, 5061]], names=[None, 'sid']))
In [3]: df
Out[3]:
value
sid 24 3766 5061
timestamp
2014-01-01 0 2 1
2014-01-02 NaN 5 4
In [4]: assets = [3766,5061,123]
In [5]: df.reindex(columns=assets,level=1)
Out[5]:
value
sid 3766 5061
timestamp
2014-01-01 2 1
2014-01-02 5 4
So this should include 123 as the last column (and all nans) as well.
The indexer returned in np.array([1,2]), but should be np.array([1,2,-1]), see here
only 1 test I could find actually tests this behavior, see here
but only tests that the SAME values are returned, not less or more (which is the point of this issue)
The text was updated successfully, but these errors were encountered:
So this should include 123 as the last column (and all nans) as well.
The indexer returned in
np.array([1,2])
, but should benp.array([1,2,-1])
, see hereonly 1 test I could find actually tests this behavior, see here
but only tests that the SAME values are returned, not less or more (which is the point of this issue)
The text was updated successfully, but these errors were encountered: