@@ -4004,16 +4004,26 @@ SAS Format
4004
4004
4005
4005
.. _io.sas :
4006
4006
4007
- The top-level function ``read_sas `` currently can only read SAS xport
4008
- (.XPT) format files. These files only contain two value types: ASCII
4009
- text and double precision numeric values. There is no automatic type
4010
- conversion to integers, dates, or categoricals. Specify a
4011
- ``chunksize `` or use ``iterator=True `` to obtain an ``XportReader ``
4012
- object for incrementally reading the file. The ``XportReader `` object
4013
- also has attributes that contain some additional information about the
4014
- file and its variables. There is currently no support for writing SAS
4015
- files.
4016
-
4007
+ The top-level function ``read_sas `` currently can read (but not write)
4008
+ SAS xport (.XPT) format files. Pandas cannot currently handle
4009
+ SAS7BDAT files. XPORT files only contain two value types: ASCII text
4010
+ and double precision numeric values. There is no automatic type
4011
+ conversion to integers, dates, or categoricals. By default the whole
4012
+ file is read and returned as a ``DataFrame ``. Specify a ``chunksize ``
4013
+ or use ``iterator=True `` to obtain an ``XportReader `` object for
4014
+ incrementally reading the file. The ``XportReader `` object also has
4015
+ attributes that contain additional information about the file and its
4016
+ variables.
4017
+
4018
+ Read a SAS XPORT file:
4019
+
4020
+ df = pd.read_sas('sas_xport.xpt')
4021
+
4022
+ Obtain an iterator and read an XPORT file 100,000 lines at a time:
4023
+
4024
+ rdr = pd.read_sas('sas_xport.xpt', chunk=100000)
4025
+ for chunk in rdr:
4026
+ do_something(chunk)
4017
4027
4018
4028
Performance Considerations
4019
4029
--------------------------
0 commit comments