Skip to content

resample with period='m' does not work on localized indexes for multiple methods in "how" #3592

Closed
@vfilimonov

Description

@vfilimonov

For the following code:

rng = pd.date_range('1/1/2011', periods=200, freq='D')
rng = rng.tz_localize('UTC')
ts = pd.Series(cumsum(randn(len(rng))), index=rng)

the following resample:
ts.resample('m', how='mean')
works fine, but this one:
ts.resample('m', how={'Mean': 'mean', 'Std': 'std'})
fails with the error: TypeError: can't compare offset-naive and offset-aware datetimes

However if we choose other interval of resampling (e.g. daily or quarterly or weekly):
ts.resample('D', how={'Mean': 'mean', 'Std': 'std'})
or
ts.resample('Q', how={'Mean': 'mean', 'Std': 'std'})
there would be no error.

OS: OSX 10.8.3
python: 2.7.4
pandas: 0.11.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions