@@ -15,24 +15,24 @@ Indexing
15
15
In pandas there are a few objects implemented which can serve as valid
16
16
containers for the axis labels:
17
17
18
- * `` Index ` `: the generic "ordered set" object, an ndarray of object dtype
18
+ * :class: ` Index `: the generic "ordered set" object, an ndarray of object dtype
19
19
assuming nothing about its contents. The labels must be hashable (and
20
20
likely immutable) and unique. Populates a dict of label to location in
21
21
Cython to do ``O(1) `` lookups.
22
22
* ``Int64Index ``: a version of ``Index `` highly optimized for 64-bit integer
23
23
data, such as time stamps
24
24
* ``Float64Index ``: a version of ``Index `` highly optimized for 64-bit float data
25
- * `` MultiIndex ` `: the standard hierarchical index object
26
- * `` DatetimeIndex `` : An Index object with `` Timestamp ` ` boxed elements (impl are the int64 values)
27
- * `` TimedeltaIndex `` : An Index object with `` Timedelta ` ` boxed elements (impl are the in64 values)
28
- * `` PeriodIndex ` `: An Index object with Period elements
25
+ * :class: ` MultiIndex `: the standard hierarchical index object
26
+ * :class: ` DatetimeIndex `: An Index object with :class: ` Timestamp ` boxed elements (impl are the int64 values)
27
+ * :class: ` TimedeltaIndex `: An Index object with :class: ` Timedelta ` boxed elements (impl are the in64 values)
28
+ * :class: ` PeriodIndex `: An Index object with Period elements
29
29
30
30
There are functions that make the creation of a regular index easy:
31
31
32
- * `` date_range ` `: fixed frequency date range generated from a time rule or
32
+ * :func: ` date_range `: fixed frequency date range generated from a time rule or
33
33
DateOffset. An ndarray of Python datetime objects
34
- * `` period_range ` `: fixed frequency date range generated from a time rule or
35
- DateOffset. An ndarray of `` Period ` ` objects, representing timespans
34
+ * :func: ` period_range `: fixed frequency date range generated from a time rule or
35
+ DateOffset. An ndarray of :class: ` Period ` objects, representing timespans
36
36
37
37
The motivation for having an ``Index `` class in the first place was to enable
38
38
different implementations of indexing. This means that it's possible for you,
@@ -43,28 +43,28 @@ From an internal implementation point of view, the relevant methods that an
43
43
``Index `` must define are one or more of the following (depending on how
44
44
incompatible the new object internals are with the ``Index `` functions):
45
45
46
- * `` get_loc ` `: returns an "indexer" (an integer, or in some cases a
46
+ * :meth: ` ~Index. get_loc `: returns an "indexer" (an integer, or in some cases a
47
47
slice object) for a label
48
- * `` slice_locs ` `: returns the "range" to slice between two labels
49
- * `` get_indexer ` `: Computes the indexing vector for reindexing / data
48
+ * :meth: ` ~Index. slice_locs `: returns the "range" to slice between two labels
49
+ * :meth: ` ~Index. get_indexer `: Computes the indexing vector for reindexing / data
50
50
alignment purposes. See the source / docstrings for more on this
51
- * `` get_indexer_non_unique ` `: Computes the indexing vector for reindexing / data
51
+ * :meth: ` ~Index. get_indexer_non_unique `: Computes the indexing vector for reindexing / data
52
52
alignment purposes when the index is non-unique. See the source / docstrings
53
53
for more on this
54
- * `` reindex ` `: Does any pre-conversion of the input index then calls
54
+ * :meth: ` ~Index. reindex `: Does any pre-conversion of the input index then calls
55
55
``get_indexer ``
56
- * `` union ``, `` intersection ` `: computes the union or intersection of two
56
+ * :meth: ` ~Index. union `, :meth: ` ~Index. intersection `: computes the union or intersection of two
57
57
Index objects
58
- * `` insert ` `: Inserts a new label into an Index, yielding a new object
59
- * `` delete ` `: Delete a label, yielding a new object
60
- * `` drop ` `: Deletes a set of labels
61
- * `` take ` `: Analogous to ndarray.take
58
+ * :meth: ` ~Index. insert `: Inserts a new label into an Index, yielding a new object
59
+ * :meth: ` ~Index. delete `: Delete a label, yielding a new object
60
+ * :meth: ` ~Index. drop `: Deletes a set of labels
61
+ * :meth: ` ~Index. take `: Analogous to ndarray.take
62
62
63
63
MultiIndex
64
64
~~~~~~~~~~
65
65
66
- Internally, the `` MultiIndex ` ` consists of a few things: the **levels **, the
67
- integer **codes ** (until version 0.24 named * labels *) , and the level **names **:
66
+ Internally, the :class: ` MultiIndex ` consists of a few things: the **levels **, the
67
+ integer **codes **, and the level **names **:
68
68
69
69
.. ipython :: python
70
70
@@ -80,13 +80,13 @@ You can probably guess that the codes determine which unique element is
80
80
identified with that location at each layer of the index. It's important to
81
81
note that sortedness is determined **solely ** from the integer codes and does
82
82
not check (or care) whether the levels themselves are sorted. Fortunately, the
83
- constructors `` from_tuples `` and `` from_arrays `` ensure that this is true, but
84
- if you compute the levels and codes yourself, please be careful.
83
+ constructors :meth: ` ~MultiIndex. from_tuples ` and :meth: ` ~MultiIndex. from_arrays ` ensure
84
+ that this is true, but if you compute the levels and codes yourself, please be careful.
85
85
86
86
Values
87
87
~~~~~~
88
88
89
- pandas extends NumPy's type system with custom types, like `` Categorical ` ` or
89
+ pandas extends NumPy's type system with custom types, like :class: ` Categorical ` or
90
90
datetimes with a timezone, so we have multiple notions of "values". For 1-D
91
91
containers (``Index `` classes and ``Series ``) we have the following convention:
92
92
0 commit comments