File tree 1 file changed +6
-5
lines changed
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -5489,10 +5489,11 @@ The top-level function :func:`read_spss` can read (but not write) SPSS
5489
5489
`sav ` (.sav) and `zsav ` (.zsav) format files(since *v0.25.0 *).
5490
5490
5491
5491
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.
5493
5494
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 ``.
5496
5497
5497
5498
Read a spss file:
5498
5499
@@ -5501,11 +5502,11 @@ Read a spss file:
5501
5502
df = pd.read_spss(' spss_data.zsav' )
5502
5503
5503
5504
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 ``:
5505
5506
5506
5507
.. code-block :: python
5507
5508
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 )
5509
5510
5510
5511
More info _ about the sav and zsav file format is available from the IBM
5511
5512
web site.
You can’t perform that action at this time.
0 commit comments