Skip to content

Commit 90c3dce

Browse files
committed
DOC: add documentation for read_spss(pandas-dev#27476)
1 parent 8677754 commit 90c3dce

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

doc/source/user_guide/io.rst

+6-5
Original file line numberDiff line numberDiff line change
@@ -5489,10 +5489,11 @@ The top-level function :func:`read_spss` can read (but not write) SPSS
54895489
`sav` (.sav) and `zsav` (.zsav) format files(since *v0.25.0*).
54905490

54915491
SPSS files contain column names. By default the
5492-
whole file is read and returned as a ``DataFrame`` with all columns.
5492+
whole file is read, categorical columns are converted into ``pd.Categorical``
5493+
and a ``DataFrame`` with all columns is returned.
54935494

5494-
Specify a ``usecols`` to obtain a subset of columns. Specify ``apply_value_formats=True``
5495-
to convert categorical columns into ``pd.Categorical``.
5495+
Specify a ``usecols`` to obtain a subset of columns. Specify ``convert_categoricals=False``
5496+
to avoid converting categorical columns into ``pd.Categorical``.
54965497

54975498
Read a spss file:
54985499

@@ -5501,11 +5502,11 @@ Read a spss file:
55015502
df = pd.read_spss('spss_data.zsav')
55025503
55035504
Extract a subset of columns ``usecols`` from SPSS file and
5504-
convert categorical columns into ``pd.Categorical``:
5505+
avoid converting categorical columns into ``pd.Categorical``:
55055506

55065507
.. code-block:: python
55075508
5508-
df = pd.read_sas('spss_data.zsav', usecols=['foo', 'bar'], apply_value_formats=True)
5509+
df = pd.read_spss('spss_data.zsav', usecols=['foo', 'bar'], convert_categoricals=False)
55095510
55105511
More info_ about the sav and zsav file format is available from the IBM
55115512
web site.

0 commit comments

Comments
 (0)