Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SAS DOC update - add documentation for sas_read(format='sas7bdat') #16420

Merged
merged 2 commits into from
May 22, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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