@@ -39,7 +39,7 @@ and labeled columns:
39
39
df = pd.DataFrame(np.random.randn(6 , 4 ), index = dates, columns = list (' ABCD' ))
40
40
df
41
41
42
- Creating a `` DataFrame ` ` by passing a dict of objects that can be converted to series-like.
42
+ Creating a :class: ` DataFrame ` by passing a dict of objects that can be converted to series-like.
43
43
44
44
.. ipython :: python
45
45
@@ -51,7 +51,7 @@ Creating a ``DataFrame`` by passing a dict of objects that can be converted to s
51
51
' F' : ' foo' })
52
52
df2
53
53
54
- The columns of the resulting `` DataFrame ` ` have different
54
+ The columns of the resulting :class: ` DataFrame ` have different
55
55
:ref: `dtypes <basics.dtypes >`.
56
56
57
57
.. ipython :: python
@@ -169,7 +169,7 @@ See the indexing documentation :ref:`Indexing and Selecting Data <indexing>` and
169
169
Getting
170
170
~~~~~~~
171
171
172
- Selecting a single column, which yields a `` Series ` `,
172
+ Selecting a single column, which yields a :class: ` Series `,
173
173
equivalent to ``df.A ``:
174
174
175
175
.. ipython :: python
@@ -469,10 +469,10 @@ Concatenating pandas objects together with :func:`concat`:
469
469
pd.concat(pieces)
470
470
471
471
.. note ::
472
- Adding a column to a `` DataFrame ` ` is relatively fast. However, adding
472
+ Adding a column to a :class: ` DataFrame ` is relatively fast. However, adding
473
473
a row requires a copy, and may be expensive. We recommend passing a
474
- pre-built list of records to the `` DataFrame ` ` constructor instead
475
- of building a `` DataFrame ` ` by iteratively appending records to it.
474
+ pre-built list of records to the :class: ` DataFrame ` constructor instead
475
+ of building a :class: ` DataFrame ` by iteratively appending records to it.
476
476
See :ref: `Appending to dataframe <merging.concatenation >` for more.
477
477
478
478
Join
@@ -520,15 +520,15 @@ See the :ref:`Grouping section <groupby>`.
520
520
' D' : np.random.randn(8 )})
521
521
df
522
522
523
- Grouping and then applying the :meth: `~DataFrame .sum ` function to the resulting
523
+ Grouping and then applying the :meth: `~pandas.core.groupby.GroupBy .sum ` function to the resulting
524
524
groups.
525
525
526
526
.. ipython :: python
527
527
528
528
df.groupby(' A' ).sum()
529
529
530
530
Grouping by multiple columns forms a hierarchical index, and again we can
531
- apply the `` sum ` ` function.
531
+ apply the :meth: ` ~pandas.core.groupby.GroupBy. sum ` function.
532
532
533
533
.. ipython :: python
534
534
@@ -648,7 +648,7 @@ the quarter end:
648
648
Categoricals
649
649
------------
650
650
651
- pandas can include categorical data in a `` DataFrame ` `. For full docs, see the
651
+ pandas can include categorical data in a :class: ` DataFrame `. For full docs, see the
652
652
:ref: `categorical introduction <categorical >` and the :ref: `API documentation <api.arrays.categorical >`.
653
653
654
654
.. ipython :: python
@@ -664,14 +664,13 @@ Convert the raw grades to a categorical data type.
664
664
df[" grade" ]
665
665
666
666
Rename the categories to more meaningful names (assigning to
667
- `` Series.cat.categories ` ` is inplace!).
667
+ :meth: ` Series.cat.categories ` is inplace!).
668
668
669
669
.. ipython :: python
670
670
671
671
df[" grade" ].cat.categories = [" very good" , " good" , " very bad" ]
672
672
673
- Reorder the categories and simultaneously add the missing categories (methods under ``Series
674
- .cat `` return a new ``Series `` by default).
673
+ Reorder the categories and simultaneously add the missing categories (methods under :meth: `Series.cat ` return a new :class: `Series ` by default).
675
674
676
675
.. ipython :: python
677
676
0 commit comments