@@ -45,21 +45,22 @@ Object Creation
45
45
46
46
See the :ref: `Data Structure Intro section <dsintro >`
47
47
48
- Creating a `` Series `` by passing a list of values, letting pandas create a default
49
- integer index
48
+ Creating a :class: ` Series ` by passing a list of values, letting pandas create
49
+ a default integer index:
50
50
51
51
.. ipython :: python
52
52
53
53
s = pd.Series([1 ,3 ,5 ,np.nan,6 ,8 ])
54
54
s
55
55
56
- Creating a ``DataFrame `` by passing a numpy array, with a datetime index and labeled columns.
56
+ Creating a :class: `DataFrame ` by passing a numpy array, with a datetime index
57
+ and labeled columns:
57
58
58
59
.. ipython :: python
59
60
60
- dates = pd.date_range(' 20130101' ,periods = 6 )
61
+ dates = pd.date_range(' 20130101' , periods = 6 )
61
62
dates
62
- df = pd.DataFrame(np.random.randn(6 ,4 ),index = dates,columns = list (' ABCD' ))
63
+ df = pd.DataFrame(np.random.randn(6 ,4 ), index = dates, columns = list (' ABCD' ))
63
64
df
64
65
65
66
Creating a ``DataFrame `` by passing a dict of objects that can be converted to series-like.
@@ -128,7 +129,7 @@ See the top & bottom rows of the frame
128
129
df.head()
129
130
df.tail(3 )
130
131
131
- Display the index,columns, and the underlying numpy data
132
+ Display the index, columns, and the underlying numpy data
132
133
133
134
.. ipython :: python
134
135
@@ -462,7 +463,7 @@ operations.
462
463
463
464
See the :ref: `Merging section <merging >`
464
465
465
- Concatenating pandas objects together
466
+ Concatenating pandas objects together with :func: ` concat `:
466
467
467
468
.. ipython :: python
468
469
@@ -555,16 +556,17 @@ Stack
555
556
df2 = df[:4 ]
556
557
df2
557
558
558
- The ``stack `` function "compresses" a level in the DataFrame's columns.
559
+ The :meth: `~DataFrame.stack ` method "compresses" a level in the DataFrame's
560
+ columns.
559
561
560
562
.. ipython :: python
561
563
562
564
stacked = df2.stack()
563
565
stacked
564
566
565
567
With a "stacked" DataFrame or Series (having a ``MultiIndex `` as the
566
- ``index ``), the inverse operation of `` stack `` is `` unstack ``, which by default
567
- unstacks the **last level **:
568
+ ``index ``), the inverse operation of :meth: ` ~DataFrame. stack ` is
569
+ :meth: ` ~DataFrame.unstack `, which by default unstacks the **last level **:
568
570
569
571
.. ipython :: python
570
572
@@ -708,7 +710,8 @@ Plotting
708
710
@savefig series_plot_basic.png
709
711
ts.plot()
710
712
711
- On DataFrame, ``plot `` is a convenience to plot all of the columns with labels:
713
+ On DataFrame, :meth: `~DataFrame.plot ` is a convenience to plot all of the
714
+ columns with labels:
712
715
713
716
.. ipython :: python
714
717
0 commit comments