Skip to content
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

Doc: Further improvements for IntervalIndex and Interval #17714

Merged

Conversation

topper-123
Copy link
Contributor

  • [x ] passes git diff upstream/master -u -- "*.py" | flake8 --diff

This follows #17706. Further changes are:

  • Taken text from the whatsnew for v0.20 and use it in advanced.rst to give more explations to IntervalIndex and Interval.
  • in interval.pyx, the doc string "Attributes" didn't parse properly, because sphinx doesn't like having "left" and "right" on the same line. They're now on separate lines and the section renamed to 'Parameters'. See current here and compare to source: http://pandas-docs.github.io/pandas-docs-travis/generated/pandas.Interval.html#pandas.Interval.
  • some examples are added to Interval
  • the warning text on IntervalIndex is now parsed properly.
  • The "See Also" had become quite large, felt it becomes more reader-friendly to combine the from_* metods into one line.
  • added cut and qcut to 'See also'

This will conclude my contributions to IntervalIndex.

@pep8speaks
Copy link

pep8speaks commented Sep 29, 2017

Hello @topper-123! Thanks for updating the PR.

Cheers ! There are no PEP8 issues in this Pull Request. 🍻

Comment last updated on September 29, 2017 at 12:08 Hours UTC

@topper-123 topper-123 changed the title Doc Doc improvements for IntervalIndex and Interval Doc: Further improvements for IntervalIndex and Interval Sep 29, 2017
@codecov
Copy link

codecov bot commented Sep 29, 2017

Codecov Report

Merging #17714 into master will decrease coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #17714      +/-   ##
==========================================
- Coverage   91.27%   91.25%   -0.02%     
==========================================
  Files         163      163              
  Lines       49765    49783      +18     
==========================================
+ Hits        45421    45430       +9     
- Misses       4344     4353       +9
Flag Coverage Δ
#multiple 89.05% <ø> (ø) ⬆️
#single 40.34% <ø> (-0.06%) ⬇️
Impacted Files Coverage Δ
pandas/core/indexes/interval.py 92.85% <ø> (ø) ⬆️
pandas/io/gbq.py 25% <0%> (-58.34%) ⬇️
pandas/core/frame.py 97.73% <0%> (-0.1%) ⬇️
pandas/core/tools/datetimes.py 83.79% <0%> (+0.82%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ad7d051...0e27cd4. Read the comment docs.

@jorisvandenbossche jorisvandenbossche added Docs Interval Interval data type labels Sep 29, 2017
Copy link
Member

@jorisvandenbossche jorisvandenbossche left a comment

Choose a reason for hiding this comment

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

Cool!

Examples
--------
>>> abc = pd.Interval(left='a', right='c', closed='both')
>>> 'b' in abc
Copy link
Member

Choose a reason for hiding this comment

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

I would also show the abc (so you see the repr)

(and personally I would find a integer (numeric) example better? (more common?))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I see that, I've changed it

@@ -105,8 +105,10 @@ class IntervalIndex(IntervalMixin, Index):

.. versionadded:: 0.20.0

Warning: the indexing behaviors are provisional and may change in
a future version of pandas.
.. Warning::
Copy link
Member

Choose a reason for hiding this comment

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

I think it is with a lower case W

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed

>>> pd.Timestamp('2017-01-01 00:00') in year_2017
True

Note
Copy link
Contributor

Choose a reason for hiding this comment

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

this doesn't actually belong here. Yes its useful info but we can't possibly list all these kinds of references, nor do we, the See Also is enough.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's been removed.

@jreback jreback added this to the 0.21.0 milestone Sep 29, 2017
@jreback
Copy link
Contributor

jreback commented Sep 29, 2017

lgtm. ping on green.

@topper-123
Copy link
Contributor Author

ping @jreback at green (I assume the failure in CircleCI has nothin to do with my PR).

@TomAugspurger
Copy link
Contributor

I've been seeing this compilation error fairly regularly:

pandas/_libs/reshape.pyx:11:0: 'numpy/float16_t.pxd' not found

I'll open a separate issue to track it.

@TomAugspurger TomAugspurger merged commit e2a0251 into pandas-dev:master Sep 29, 2017
@topper-123 topper-123 deleted the IntervalIndex_docstring_II branch September 29, 2017 16:08
ghost pushed a commit to reef-technologies/pandas that referenced this pull request Oct 2, 2017
* 'master' of github.com:pandas-dev/pandas: (188 commits)
  Separate out _convert_datetime_to_tsobject (pandas-dev#17715)
  DOC: remove whatsnew note for xref pandas-dev#17131
  BUG: Regression in .loc accepting a boolean Index as an indexer (pandas-dev#17738)
  DEPR: Deprecate cdate_range and merge into bdate_range (pandas-dev#17691)
  CLN: replace %s syntax with .format in pandas.core: categorical, common, config, config_init (pandas-dev#17735)
  Fixed the memory usage explanation of categorical in gotchas from O(nm) to O(n+m) (pandas-dev#17736)
  TST: add backward compat for offset testing for pickles (pandas-dev#17733)
  remove unused time conversion funcs (pandas-dev#17711)
  DEPR: Deprecate convert parameter in take (pandas-dev#17352)
  BUG:Time Grouper bug fix when applied for list groupers (pandas-dev#17587)
  BUG: Fix some PeriodIndex resampling issues (pandas-dev#16153)
  BUG: Fix unexpected sort in groupby (pandas-dev#17621)
  DOC: Fixed typo in documentation for 'pandas.DataFrame.replace' (pandas-dev#17731)
  BUG: Fix series rename called with str altering name rather index (GH17407) (pandas-dev#17654)
  DOC: Add examples for MultiIndex.get_locs + cleanups (pandas-dev#17675)
  Doc improvements for IntervalIndex and Interval (pandas-dev#17714)
  BUG: DataFrame sort_values and multiple "by" columns fails to order NaT correctly
  Last of the timezones funcs (pandas-dev#17669)
  Add missing file to _pyxfiles, delete commented-out (pandas-dev#17712)
  update imports of DateParseError, remove unused imports from tslib (pandas-dev#17713)
  ...
alanbato pushed a commit to alanbato/pandas that referenced this pull request Nov 10, 2017
No-Stream pushed a commit to No-Stream/pandas that referenced this pull request Nov 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs Interval Interval data type
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants