Skip to content

Commit db1bec3

Browse files
committed
Added example to io.rst
1 parent 209c202 commit db1bec3

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

doc/source/io.rst

+20-10
Original file line numberDiff line numberDiff line change
@@ -4004,16 +4004,26 @@ SAS Format
40044004

40054005
.. _io.sas:
40064006

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)
40174027

40184028
Performance Considerations
40194029
--------------------------

0 commit comments

Comments
 (0)