@@ -19,37 +19,37 @@ General terminology translation
1919 :header: "pandas", "SPSS"
2020 :widths: 20, 20
2121
22- `` DataFrame ` `, data file
22+ :class: ` DataFrame `, data file
2323 column, variable
2424 row, case
2525 groupby, split file
26- `` NaN ` `, system-missing
26+ :class: ` NaN `, system-missing
2727
28- `` DataFrame ` `
28+ :class: ` DataFrame `
2929~~~~~~~~~~~~~
3030
31- A `` DataFrame ` ` in pandas is analogous to an SPSS data file - a two-dimensional
31+ A :class: ` DataFrame ` in pandas is analogous to an SPSS data file - a two-dimensional
3232data source with labeled columns that can be of different types. As will be shown in this
3333document, almost any operation that can be performed in SPSS can also be accomplished in pandas.
3434
35- `` Series ` `
35+ :class: ` Series `
3636~~~~~~~~~~
3737
38- A `` Series `` is the data structure that represents one column of a `` DataFrame ` `. SPSS doesn't have a
39- separate data structure for a single variable, but in general, working with a `` Series ` ` is analogous
38+ A :class: ` Series ` is the data structure that represents one column of a :class: ` DataFrame `. SPSS doesn't have a
39+ separate data structure for a single variable, but in general, working with a :class: ` Series ` is analogous
4040to working with a variable in SPSS.
4141
42- `` Index ` `
42+ :class: ` Index `
4343~~~~~~~~~
4444
45- Every `` DataFrame `` and `` Series `` has an `` Index ` ` -- labels on the *rows * of the data. SPSS does not
45+ Every :class: ` DataFrame ` and :class: ` Series ` has an :class: ` Index ` -- labels on the *rows * of the data. SPSS does not
4646have an exact analogue, as cases are simply numbered sequentially from 1. In pandas, if no index is
47- specified, a `` RangeIndex ` ` is used by default (first row = 0, second row = 1, and so on).
47+ specified, a :class: ` RangeIndex ` is used by default (first row = 0, second row = 1, and so on).
4848
49- While using a labeled `` Index `` or `` MultiIndex ` ` can enable sophisticated analyses and is ultimately an
50- important part of pandas to understand, for this comparison we will essentially ignore the `` Index ` ` and
51- just treat the `` DataFrame ` ` as a collection of columns. Please see the :ref: `indexing documentation<indexing> `
52- for much more on how to use an `` Index ` ` effectively.
49+ While using a labeled :class: ` Index ` or :class: ` MultiIndex ` can enable sophisticated analyses and is ultimately an
50+ important part of pandas to understand, for this comparison we will essentially ignore the :class: ` Index ` and
51+ just treat the :class: ` DataFrame ` as a collection of columns. Please see the :ref: `indexing documentation<indexing> `
52+ for much more on how to use an :class: ` Index ` effectively.
5353
5454
5555Copies vs. in place operations
@@ -81,7 +81,7 @@ In SPSS, you would use File > Open > Data to import a CSV file:
8181
8282 The pandas equivalent would use :func: `read_csv `:
8383
84- .. ipython :: python
84+ .. code-block :: python
8585
8686 url = (
8787 " https://raw.githubusercontent.com/pandas-dev"
@@ -116,7 +116,7 @@ In SPSS, filtering is done through Data > Select Cases:
116116
117117 In pandas, boolean indexing can be used:
118118
119- .. ipython :: python
119+ .. code-block :: python
120120
121121 tips[tips[" total_bill" ] > 10 ]
122122
@@ -133,7 +133,7 @@ In SPSS, sorting is done through Data > Sort Cases:
133133
134134 In pandas, this would be written as:
135135
136- .. ipython :: python
136+ .. code-block :: python
137137
138138 tips.sort_values([" sex" , " total_bill" ])
139139
@@ -194,7 +194,7 @@ In SPSS, split-file analysis is done through Data > Split File:
194194
195195 The pandas equivalent would be:
196196
197- .. ipython :: python
197+ .. code-block :: python
198198
199199 tips.groupby(" sex" )[[" total_bill" , " tip" ]].agg([" mean" , " std" , " min" , " max" ])
200200
0 commit comments