pandas.read_sas¶
- pandas.read_sas(filepath_or_buffer, format='xport', index=None, encoding='ISO-8859-1', chunksize=None, iterator=False)¶
Read a SAS file into a DataFrame.
Parameters: filepath_or_buffer : string or file-like object
Path to SAS file or object implementing binary read method.
format : string
File format, only xport is currently supported.
index : identifier of index column
Identifier of column that should be used as index of the DataFrame.
encoding : string
Encoding for text data.
chunksize : int
Read file chunksize lines at a time, returns iterator.
iterator : boolean, default False
Return XportReader object for reading file incrementally.
Returns: DataFrame or XportReader
Examples
Read a SAS Xport file:
>>> df = pandas.read_sas('filename.XPT')
Read a Xport file in 10,000 line chunks:
>>> itr = pandas.read_sas('filename.XPT', chunksize=10000) >>> for chunk in itr: >>> do_something(chunk)
New in version 0.17.0.