Skip to content

Add informal definition of "label" in note #27005

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

Closed
wants to merge 2 commits into from

Conversation

sgpinkus
Copy link

The term "label" is used extenisively, but (AFAICT) it is never explained what a "label" is. Is an integer offset a label? Do labels apply to rows and columns, multi-indexes? What's the relation between an "index" "axis" and "label" ... etc.

  • closes #xxxx
  • tests added / passed
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • whatsnew entry

The term "label" is used extenisively, but (AFAICT) it is never explained what a "label" is. Is an integer offset a label? Do labels apply to rows and columns, multi-indexes? What's the relation between an "index" "axis" and "label" ... etc.
@codecov
Copy link

codecov bot commented Jun 23, 2019

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #27005      +/-   ##
==========================================
- Coverage   91.99%   91.99%   -0.01%     
==========================================
  Files         180      180              
  Lines       50774    50774              
==========================================
- Hits        46712    46708       -4     
- Misses       4062     4066       +4
Flag Coverage Δ
#multiple 90.63% <ø> (ø) ⬆️
#single 41.85% <ø> (-0.09%) ⬇️
Impacted Files Coverage Δ
pandas/io/gbq.py 88.88% <0%> (-11.12%) ⬇️
pandas/core/frame.py 96.89% <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 b4d4ec5...d592cb3. Read the comment docs.

@codecov
Copy link

codecov bot commented Jun 23, 2019

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #27005      +/-   ##
==========================================
- Coverage   91.99%   91.99%   -0.01%     
==========================================
  Files         180      180              
  Lines       50774    50774              
==========================================
- Hits        46712    46708       -4     
- Misses       4062     4066       +4
Flag Coverage Δ
#multiple 90.63% <ø> (ø) ⬆️
#single 41.85% <ø> (-0.09%) ⬇️
Impacted Files Coverage Δ
pandas/io/gbq.py 88.88% <0%> (-11.12%) ⬇️
pandas/core/frame.py 96.89% <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 b4d4ec5...0374241. Read the comment docs.

@WillAyd
Copy link
Member

WillAyd commented Jun 23, 2019

I find this note a little confusing. Would just mentioning that a label is an object that provides an alternative to positional selection suffice?

@WillAyd WillAyd added the Docs label Jun 23, 2019
@sgpinkus
Copy link
Author

I agree. It is too verbose, and there is already too many notes and warnings (which I tend to have a habit of not reading anyway :)). I will re-word.

Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

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

Hmm still not sure this is it but cc @datapythonista in case he has any insight to offer

@@ -6,17 +6,18 @@
Indexing and Selecting Data
***************************

The axis labeling information in pandas objects serves many purposes:
In pandas, data structure axes such as the rows and columns of a DataFrame may have
Copy link
Member

Choose a reason for hiding this comment

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

To be clear, an Index (which is used for selection along an axis) does have labels. This is a main thing that separates pandas from libraries like NumPy

Copy link
Author

@sgpinkus sgpinkus Jun 30, 2019

Choose a reason for hiding this comment

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

Yes I know. It's actually quite challenging to unpack axis, index, labels, positional indexation via integers in a sentence or two. An index really is labels. I found it an improvement over "axis labeling information ... serves many purposes", by being less nebulous and vague.

@datapythonista
Copy link
Member

I agree that we should be more explicit on the terms we used. I think we discussed in the past about having a glossary, which I think it's the right way to address this. I could only find this related issue: #21784

I don't think this PR is helping much. I'll close this, and open an issue for the glossary, feel free to work on that.

@WillAyd
Copy link
Member

WillAyd commented Jun 24, 2019

Sounds good. May be loosely intertwined with what we are defining in pandas._typing

@sam-at-github thanks for the PR. To the point above though I think we'd rather make a more comprehensive change than what is offered here. Would certainly value input if you'd like to put thoughts into the other issue

@datapythonista
Copy link
Member

Sorry, re-reading my last comment, just realized that probably didn't sound really nice... Not my intention.

@sam-at-github thanks for your contribution, and it really helps, since this is very helpful feedback. I opened #27019 since I think a glossary will make it easier to address what you're addressing here. Feel free to continue the work you started here, but I think it makes more sense to close this, and continue in a PR that addresses that issue.

Thanks!

@sgpinkus
Copy link
Author

Sounds like perfect is the enemy of the good around here. Good luck with glossary.

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