@@ -50,9 +50,8 @@ Attributes and the raw ndarray(s)
50
50
51
51
pandas objects have a number of attributes enabling you to access the metadata
52
52
53
- * **shape **: gives the axis dimensions of the object, consistent with ndarray
54
- * Axis labels
55
-
53
+ * **shape **: gives the axis dimensions of the object, consistent with ndarray
54
+ * Axis labels
56
55
* **Series **: *index * (only axis)
57
56
* **DataFrame **: *index * (rows) and *columns *
58
57
* **Panel **: *items *, *major_axis *, and *minor_axis *
@@ -131,9 +130,9 @@ Flexible binary operations
131
130
With binary operations between pandas data structures, there are two key points
132
131
of interest:
133
132
134
- * Broadcasting behavior between higher- (e.g. DataFrame) and
135
- lower-dimensional (e.g. Series) objects.
136
- * Missing data in computations.
133
+ * Broadcasting behavior between higher- (e.g. DataFrame) and
134
+ lower-dimensional (e.g. Series) objects.
135
+ * Missing data in computations.
137
136
138
137
We will demonstrate how to manage these issues independently, though they can
139
138
be handled simultaneously.
@@ -168,7 +167,7 @@ either match on the *index* or *columns* via the **axis** keyword:
168
167
169
168
df_orig = df
170
169
171
- Furthermore you can align a level of a multi-indexed DataFrame with a Series.
170
+ Furthermore you can align a level of a MultiIndexed DataFrame with a Series.
172
171
173
172
.. ipython :: python
174
173
@@ -462,10 +461,10 @@ produce an object of the same size. Generally speaking, these methods take an
462
461
**axis ** argument, just like *ndarray.{sum, std, ...} *, but the axis can be
463
462
specified by name or integer:
464
463
465
- - **Series **: no axis argument needed
466
- - **DataFrame **: "index" (axis=0, default), "columns" (axis=1)
467
- - **Panel **: "items" (axis=0), "major" (axis=1, default), "minor"
468
- (axis=2)
464
+ * **Series **: no axis argument needed
465
+ * **DataFrame **: "index" (axis=0, default), "columns" (axis=1)
466
+ * **Panel **: "items" (axis=0), "major" (axis=1, default), "minor"
467
+ (axis=2)
469
468
470
469
For example:
471
470
@@ -593,7 +592,7 @@ categorical columns:
593
592
frame = pd.DataFrame({' a' : [' Yes' , ' Yes' , ' No' , ' No' ], ' b' : range (4 )})
594
593
frame.describe()
595
594
596
- This behaviour can be controlled by providing a list of types as ``include ``/``exclude ``
595
+ This behavior can be controlled by providing a list of types as ``include ``/``exclude ``
597
596
arguments. The special value ``all `` can also be used:
598
597
599
598
.. ipython :: python
@@ -1034,7 +1033,7 @@ Passing a single function to ``.transform()`` with a ``Series`` will yield a sin
1034
1033
Transform with multiple functions
1035
1034
+++++++++++++++++++++++++++++++++
1036
1035
1037
- Passing multiple functions will yield a column multi-indexed DataFrame.
1036
+ Passing multiple functions will yield a column MultiIndexed DataFrame.
1038
1037
The first level will be the original frame column names; the second level
1039
1038
will be the names of the transforming functions.
1040
1039
@@ -1060,7 +1059,7 @@ Passing a dict of functions will allow selective transforming per column.
1060
1059
1061
1060
tsdf.transform({' A' : np.abs, ' B' : lambda x : x+ 1 })
1062
1061
1063
- Passing a dict of lists will generate a multi-indexed DataFrame with these
1062
+ Passing a dict of lists will generate a MultiIndexed DataFrame with these
1064
1063
selective transforms.
1065
1064
1066
1065
.. ipython :: python
@@ -1187,11 +1186,11 @@ It is used to implement nearly all other features relying on label-alignment
1187
1186
functionality. To *reindex * means to conform the data to match a given set of
1188
1187
labels along a particular axis. This accomplishes several things:
1189
1188
1190
- * Reorders the existing data to match a new set of labels
1191
- * Inserts missing value (NA) markers in label locations where no data for
1192
- that label existed
1193
- * If specified, **fill ** data for missing labels using logic (highly relevant
1194
- to working with time series data)
1189
+ * Reorders the existing data to match a new set of labels
1190
+ * Inserts missing value (NA) markers in label locations where no data for
1191
+ that label existed
1192
+ * If specified, **fill ** data for missing labels using logic (highly relevant
1193
+ to working with time series data)
1195
1194
1196
1195
Here is a simple example:
1197
1196
@@ -1889,12 +1888,12 @@ faster than sorting the entire Series and calling ``head(n)`` on the result.
1889
1888
df.nsmallest(5 , [' a' , ' c' ])
1890
1889
1891
1890
1892
- .. _basics.multi-index_sorting :
1891
+ .. _basics.multiindex_sorting :
1893
1892
1894
- Sorting by a multi-index column
1895
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1893
+ Sorting by a MultiIndex column
1894
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1896
1895
1897
- You must be explicit about sorting when the column is a multi-index , and fully specify
1896
+ You must be explicit about sorting when the column is a MultiIndex , and fully specify
1898
1897
all levels to ``by ``.
1899
1898
1900
1899
.. ipython :: python
@@ -1911,10 +1910,10 @@ the axis indexes, since they are immutable) and returns a new object. Note that
1911
1910
**it is seldom necessary to copy objects **. For example, there are only a
1912
1911
handful of ways to alter a DataFrame *in-place *:
1913
1912
1914
- * Inserting, deleting, or modifying a column.
1915
- * Assigning to the ``index `` or ``columns `` attributes.
1916
- * For homogeneous data, directly modifying the values via the ``values ``
1917
- attribute or advanced indexing.
1913
+ * Inserting, deleting, or modifying a column.
1914
+ * Assigning to the ``index `` or ``columns `` attributes.
1915
+ * For homogeneous data, directly modifying the values via the ``values ``
1916
+ attribute or advanced indexing.
1918
1917
1919
1918
To be clear, no pandas method has the side effect of modifying your data;
1920
1919
almost every method returns a new object, leaving the original object
@@ -2112,22 +2111,22 @@ Because the data was transposed the original inference stored all columns as obj
2112
2111
The following functions are available for one dimensional object arrays or scalars to perform
2113
2112
hard conversion of objects to a specified type:
2114
2113
2115
- - :meth: `~pandas.to_numeric ` (conversion to numeric dtypes)
2114
+ * :meth: `~pandas.to_numeric ` (conversion to numeric dtypes)
2116
2115
2117
2116
.. ipython :: python
2118
2117
2119
2118
m = [' 1.1' , 2 , 3 ]
2120
2119
pd.to_numeric(m)
2121
2120
2122
- - :meth: `~pandas.to_datetime ` (conversion to datetime objects)
2121
+ * :meth: `~pandas.to_datetime ` (conversion to datetime objects)
2123
2122
2124
2123
.. ipython :: python
2125
2124
2126
2125
import datetime
2127
2126
m = [' 2016-07-09' , datetime.datetime(2016 , 3 , 2 )]
2128
2127
pd.to_datetime(m)
2129
2128
2130
- - :meth: `~pandas.to_timedelta ` (conversion to timedelta objects)
2129
+ * :meth: `~pandas.to_timedelta ` (conversion to timedelta objects)
2131
2130
2132
2131
.. ipython :: python
2133
2132
0 commit comments