From d592cb3239eee169cb95287158b9f823264d3345 Mon Sep 17 00:00:00 2001 From: sam-at-github Date: Sun, 23 Jun 2019 16:10:54 +1000 Subject: [PATCH 1/2] Add informal definition of "label" in note 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. --- doc/source/user_guide/indexing.rst | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/doc/source/user_guide/indexing.rst b/doc/source/user_guide/indexing.rst index 4ea7c656fd197..48352783b9860 100644 --- a/doc/source/user_guide/indexing.rst +++ b/doc/source/user_guide/indexing.rst @@ -6,7 +6,7 @@ Indexing and Selecting Data *************************** -The axis labeling information in pandas objects serves many purposes: +Axis *labeling* information in pandas objects serves many purposes: * Identifies data (i.e. provides *metadata*) using known indicators, important for analysis, visualization, and interactive console display. @@ -16,7 +16,14 @@ The axis labeling information in pandas objects serves many purposes: In this section, we will focus on the final point: namely, how to slice, dice, and generally get and set subsets of pandas objects. The primary focus will be on Series and DataFrame as they have received more development attention in -this area. +this area. + +.. note:: + + Throughout the documentation we typically use the term "label" to refer to the items of + a Pandas index labelling some axis. I.e. a Series has a single axis that may be "labelled" + by specifying a Pandas Index (a MultiIndex is a type of index). A DataFrame has two axes + (rows and columns) each of which maybe "labelled" by specifying an index. .. note:: From 0374241af3154381cda5fe4132acb536ad518c46 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 24 Jun 2019 06:56:31 +1000 Subject: [PATCH 2/2] Fix --- doc/source/user_guide/indexing.rst | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/doc/source/user_guide/indexing.rst b/doc/source/user_guide/indexing.rst index 48352783b9860..862c35176d90a 100644 --- a/doc/source/user_guide/indexing.rst +++ b/doc/source/user_guide/indexing.rst @@ -6,25 +6,19 @@ Indexing and Selecting Data *************************** -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 +labels associated with them. Axis labeling in pandas is primarily used to: -* Identifies data (i.e. provides *metadata*) using known indicators, +* Identify data (i.e. provide *metadata*) using known indicators, important for analysis, visualization, and interactive console display. -* Enables automatic and explicit data alignment. -* Allows intuitive getting and setting of subsets of the data set. +* Enable automatic and explicit data alignment. +* Allow intuitive getting and setting of subsets of the data set. In this section, we will focus on the final point: namely, how to slice, dice, and generally get and set subsets of pandas objects. The primary focus will be on Series and DataFrame as they have received more development attention in this area. -.. note:: - - Throughout the documentation we typically use the term "label" to refer to the items of - a Pandas index labelling some axis. I.e. a Series has a single axis that may be "labelled" - by specifying a Pandas Index (a MultiIndex is a type of index). A DataFrame has two axes - (rows and columns) each of which maybe "labelled" by specifying an index. - .. note:: The Python and NumPy indexing operators ``[]`` and attribute operator ``.``