4
4
5
5
Comparison with SPSS
6
6
********************
7
- For potential users coming from `SPSS <https://www.ibm.com/spss >`__, this page is meant to demonstrate
7
+ For potential users coming from `SPSS <https://www.ibm.com/spss >`__, this page is meant to demonstrate
8
8
how various SPSS operations would be performed using pandas.
9
9
10
10
.. include :: includes/introduction.rst
@@ -20,7 +20,7 @@ General terminology translation
20
20
:widths: 20, 20
21
21
22
22
``DataFrame ``, data file
23
- column, variable
23
+ column, variable
24
24
row, case
25
25
groupby, split file
26
26
``NaN ``, system-missing
@@ -29,7 +29,7 @@ General terminology translation
29
29
~~~~~~~~~~~~~
30
30
31
31
A ``DataFrame `` in pandas is analogous to an SPSS data file - a two-dimensional
32
- data source with labeled columns that can be of different types. As will be shown in this
32
+ data source with labeled columns that can be of different types. As will be shown in this
33
33
document, almost any operation that can be performed in SPSS can also be accomplished in pandas.
34
34
35
35
``Series ``
@@ -42,13 +42,13 @@ to working with a variable in SPSS.
42
42
``Index ``
43
43
~~~~~~~~~
44
44
45
- Every ``DataFrame `` and ``Series `` has an ``Index `` -- labels on the *rows * of the data. SPSS does not
46
- have an exact analogue, as cases are simply numbered sequentially from 1. In pandas, if no index is
45
+ Every ``DataFrame `` and ``Series `` has an ``Index `` -- labels on the *rows * of the data. SPSS does not
46
+ have an exact analogue, as cases are simply numbered sequentially from 1. In pandas, if no index is
47
47
specified, a ``RangeIndex `` is used by default (first row = 0, second row = 1, and so on).
48
48
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> `
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
52
for much more on how to use an ``Index `` effectively.
53
53
54
54
@@ -64,7 +64,7 @@ Data input / output
64
64
Reading external data
65
65
~~~~~~~~~~~~~~~~~~~~
66
66
67
- Like SPSS, pandas provides utilities for reading in data from many formats. The ``tips `` dataset, found within
67
+ Like SPSS, pandas provides utilities for reading in data from many formats. The ``tips `` dataset, found within
68
68
the pandas tests (`csv <https://raw.githubusercontent.com/pandas-dev/pandas/main/pandas/tests/io/data/csv/tips.csv >`_)
69
69
will be used in many of the following examples.
70
70
@@ -226,4 +226,4 @@ capture and export results in various ways:
226
226
# Save multiple results to Excel sheets
227
227
with pd.ExcelWriter(' results.xlsx' ) as writer:
228
228
tips.describe().to_excel(writer, sheet_name = ' Descriptives' )
229
- tips.groupby(' sex' ).mean().to_excel(writer, sheet_name = ' Means by Gender' )
229
+ tips.groupby(' sex' ).mean().to_excel(writer, sheet_name = ' Means by Gender' )
0 commit comments