Skip to content

DOC: Documentation for pandas.core.indexes.api #22980

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 12 commits into from
Nov 4, 2018

Conversation

lowerthansound
Copy link

The functions on pandas.core.indexes.api had almost no documentation. This is an attempt to explain them better and a progress towards #22915.

@pep8speaks
Copy link

Hello @araraonline! Thanks for submitting the PR.

@codecov
Copy link

codecov bot commented Oct 4, 2018

Codecov Report

Merging #22980 into master will increase coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #22980      +/-   ##
==========================================
+ Coverage   92.19%   92.19%   +<.01%     
==========================================
  Files         169      169              
  Lines       50911    50922      +11     
==========================================
+ Hits        46939    46950      +11     
  Misses       3972     3972
Flag Coverage Δ
#multiple 90.62% <ø> (ø) ⬆️
#single 42.3% <ø> (-0.01%) ⬇️
Impacted Files Coverage Δ
pandas/core/indexes/api.py 98.91% <ø> (ø) ⬆️
pandas/core/generic.py 96.65% <0%> (ø) ⬆️
pandas/core/arrays/base.py 95.89% <0%> (ø) ⬆️
pandas/core/util/hashing.py 98.4% <0%> (+0.03%) ⬆️
pandas/core/indexes/period.py 93.44% <0%> (+0.12%) ⬆️

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 f6da1f1...62e7a3e. Read the comment docs.

@lowerthansound lowerthansound force-pushed the indexapi-document branch 3 times, most recently from 19df70c to e55f9b3 Compare October 4, 2018 22:35

Parameters
----------
indexes: a list of Index or array-like objects
Copy link
Author

@lowerthansound lowerthansound Oct 5, 2018

Choose a reason for hiding this comment

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

Actually, this should be 'a list of Index or list objects'

Will fix soon

@jreback jreback added the Docs label Oct 6, 2018
@jreback jreback added this to the 0.24.0 milestone Oct 6, 2018
@jreback
Copy link
Contributor

jreback commented Oct 6, 2018

context looks ok, @datapythonista or @jorisvandenbossche if you want to glance at the doc-strings; these are internal only

Copy link
Member

@datapythonista datapythonista left a comment

Choose a reason for hiding this comment

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

Looks good, it's nice to have docs in those functions.

Few comments about formatting that apply to all docstrings:

  • Start he docstring in the next line of """, not in the same
  • Missing space before colon in Parameters param_name : type
  • Missing period at the end of the parameter descriptions, and the returns description.
  • Use Python types for parameter types (or returns), for example bool instead of boolean. And have just the type, for example list of bool instead of a list of bool


- [list, list, ...]: Return ([list, list, ...], 'list')
- [list, Index, ...]: Return _sanitize_and_check([Index, Index, ...])
Lists are sorted and converted to Index
Copy link
Author

Choose a reason for hiding this comment

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

Will add period to this too

@@ -144,6 +229,21 @@ def _sanitize_and_check(indexes):


def _get_consensus_names(indexes):
"""
Give a consensus 'names' to indexes,
Copy link
Author

Choose a reason for hiding this comment

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

my bad

Copy link
Member

@datapythonista datapythonista left a comment

Choose a reason for hiding this comment

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

Thanks for adding these docs, and sorry for the delay in reviewing.

@datapythonista datapythonista merged commit 0aa9efa into pandas-dev:master Nov 4, 2018
JustinZhengBC pushed a commit to JustinZhengBC/pandas that referenced this pull request Nov 14, 2018
tm9k1 pushed a commit to tm9k1/pandas that referenced this pull request Nov 19, 2018
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
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.

4 participants