Skip to content

DOC: add PeriodIndex.asfreq docstring #10051

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 9, 2015

Conversation

TomAugspurger
Copy link
Contributor

Part of #6384

I guess PeriodIndex don't show up in the API docs at all. Not sure if I'll get to any more.

Convert the PeriodIndex to the specified frequency `freq`.

Parameters
==========
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you use --- instead of === for the lines? (to be consistent with the other docstrings)

@TomAugspurger
Copy link
Contributor Author

@jorisvandenbossche thanks. Should be good now I think

Returns
-------

new: PeriodIndex with the new frequency
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a small one :-)
here also a space between new and :

@jorisvandenbossche
Copy link
Member

@TomAugspurger added some more .. :-)

@jreback
Copy link
Contributor

jreback commented May 9, 2015

@TomAugspurger can you update?

@TomAugspurger
Copy link
Contributor Author

@jreback done. Merge when you're ready.

@jorisvandenbossche
Copy link
Member

@TomAugspurger I think you forgot to add your changes

@TomAugspurger
Copy link
Contributor Author

Seems to be good now.

@jreback
Copy link
Contributor

jreback commented May 9, 2015

I realize after we merge index-repr prob need to fix s bunch of doc strings :(

@jreback jreback added this to the 0.16.1 milestone May 9, 2015
@jreback
Copy link
Contributor

jreback commented May 9, 2015

e.g. will be.

In [1]: pidx = pd.period_range('2010-01-01', '2015-01-01', freq='A')

In [2]: pidx
Out[2]: PeriodIndex(['2010', '2011', '2012', '2013', '2014', '2015'], dtype='int64', freq='A-DEC')

In [3]: pidx.asfreq('M')
Out[3]: PeriodIndex(['2010-12', '2011-12', '2012-12', '2013-12', '2014-12', '2015-12'], dtype='int64', freq='M')

In [4]: pidx.asfreq('M', how='S')
Out[4]: PeriodIndex(['2010-01', '2011-01', '2012-01', '2013-01', '2014-01', '2015-01'], dtype='int64', freq='M')

@jorisvandenbossche
Copy link
Member

Indeed. A search for <class 'pandas.tseries.period.PeriodIndex'> and alike can help there maybe. I will open an issue for that. -> #10094

jorisvandenbossche added a commit that referenced this pull request May 9, 2015
DOC: add PeriodIndex.asfreq docstring
@jorisvandenbossche jorisvandenbossche merged commit 3c0e66d into pandas-dev:master May 9, 2015
@TomAugspurger TomAugspurger deleted the asfreq-doc branch April 5, 2017 02:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants