Skip to content

Commit

Permalink
SAS DOC update - add documentation for sas_read(format='sas7bdat') (p…
Browse files Browse the repository at this point in the history
…andas-dev#16420)

* updating comparison_with_sas.rst to include documentation for reading sas7bdat format

* DOC: update docs for read_sas(format='sas7bdat') pandas-dev#12700

Issue pandas-dev#12700: DOC: update comparison_with_sas docs to include new read_sas(format='sas7bdat')
  • Loading branch information
economy authored and TomAugspurger committed May 22, 2017
1 parent 1f2085e commit 49ec31b
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions doc/source/comparison_with_sas.rst
Original file line number Diff line number Diff line change
Expand Up @@ -577,9 +577,8 @@ Data Interop
~~~~~~~~~~~~

pandas provides a :func:`read_sas` method that can read SAS data saved in
the XPORT format. The ability to read SAS's binary format is planned for a
future release.

the XPORT or SAS7BDAT binary format.

.. code-block:: none
libname xportout xport 'transport-file.xpt';
Expand All @@ -591,6 +590,15 @@ future release.
.. code-block:: python
df = pd.read_sas('transport-file.xpt')
df = pd.read_sas('binary-file.sas7bdat')
You can also specify the file format directly. By default, pandas will try
to infer the file format based on its extension.

.. code-block:: python
df = pd.read_sas('transport-file.xpt', format='xport')
df = pd.read_sas('binary-file.sas7bdat', format='sas7bdat')
XPORT is a relatively limited format and the parsing of it is not as
optimized as some of the other pandas readers. An alternative way
Expand All @@ -605,3 +613,4 @@ to interop data between SAS and pandas is to serialize to csv.
In [9]: %time df = pd.read_csv('big.csv')
Wall time: 4.86 s

0 comments on commit 49ec31b

Please sign in to comment.