A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pandas-dev/pandas/issues/7376 below:

bug in replace? · Issue #7376 · pandas-dev/pandas · GitHub

I think this is distinct from #5541 though I agree that an API change here might be helpful. AFAICT, I am using replace as 'expected', but all of the keys aren't being matched. Any idea what's going on?

d = {u'fname' :
    {'out_augmented_AUG_2011.json' : pd.Period(year=2011, month=8, freq='M'), 
    'out_augmented_JAN_2011.json' : pd.Period(year=2011, month=1, freq='M'),
    'out_augmented_MAY_2012.json' : pd.Period(year=2012, month=5, freq='M'),
    'out_augmented_SUBSIDY_WEEK.json' : pd.Period(year=2011, month=4, freq='M'),
    'out_augmented_AUG_2012.json' : pd.Period(year=2012, month=8, freq='M'),
    'out_augmented_MAY_2011.json' : pd.Period(year=2011, month=5, freq='M'),
    'out_augmented_SEP_2013.json' : pd.Period(year=2013, month=9, freq='M'),
    }}

df = pd.DataFrame(['out_augmented_AUG_2012.json',
                'out_augmented_SEP_2013.json',
                'out_augmented_SUBSIDY_WEEK.json',
                'out_augmented_MAY_2012.json',
                'out_augmented_MAY_2011.json',
                'out_augmented_AUG_2011.json',
                'out_augmented_JAN_2011.json'], columns=['fname'])

df.replace(d)

On

[31]: pd.version.version
[31]: '0.13.1-753-g4614ac8'

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4