Skip to content

BUG: reindex by both index and columns loses DatetimeIndex frequency #3317

Closed
@joeb1415

Description

@joeb1415

Given:

from numpy import ones
from pandas import DataFrame, __version__
df = DataFrame(ones((3, 3)), index=[datetime(2012, 1, 1), datetime(2012, 1, 2), datetime(2012, 1, 3)], columns=['a', 'b', 'c'])

time_freq = date_range('2012-01-01', '2012-01-03', freq='d')
some_cols = ['a', 'b']

We get:

__version__

'0.10.1'

df.reindex(index=time_freq).index.freq

<1 Day>

df.reindex(index=time_freq, columns=some_cols).index.freq

None

df.reindex(index=time_freq).reindex(columns=some_cols).index.freq

<1 Day>

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugIndexingRelated to indexing on series/frames, not to indexes themselves

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions