Skip to content

Commit 4f60da9

Browse files
committed
Added StataParser to release notes and updated io.rst
1 parent 70fed82 commit 4f60da9

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed

RELEASE.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ pandas 0.11.1
3333
- pd.read_html() can now parse HTML string, files or urls and return dataframes
3434
courtesy of @cpcloud. (GH3477_)
3535
- Support for reading Amazon S3 files. (GH3504_)
36+
- Added module for reading and writing Stata files: pandas.io.stata (GH1512_)
3637

3738
**Improvements to existing features**
3839

@@ -166,6 +167,7 @@ pandas 0.11.1
166167
.. _GH3610: https://github.com/pydata/pandas/issues/3610
167168
.. _GH3596: https://github.com/pydata/pandas/issues/3596
168169
.. _GH3435: https://github.com/pydata/pandas/issues/3435
170+
.. _GH1512: https://github.com/pydata/pandas/issues/1512
169171

170172

171173
pandas 0.11.0

doc/source/io.rst

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1829,3 +1829,44 @@ There are a few other available functions:
18291829

18301830
For now, writing your DataFrame into a database works only with
18311831
**SQLite**. Moreover, the **index** will currently be **dropped**.
1832+
1833+
1834+
Reading from STATA format
1835+
~~~~~~~~~~~~~~~~~~~~~~
1836+
1837+
.. _io.StataReader:
1838+
1839+
.. versionadded:: 0.11.1
1840+
1841+
The class StataReader will read the header of the given dta file at
1842+
initialization. Its function :func:'~pandas.io.StataReader.data' will
1843+
read the observations, converting them to a DataFrame which is returned:
1844+
1845+
.. ipython:: python
1846+
reader = StataReader(dta_filepath)
1847+
dataframe = reader.data()
1848+
1849+
The parameter convert_categoricals indicates wheter value labels should be
1850+
read and used to create a Categorical variable from them. Value labels can
1851+
also be retrieved by the function variable_labels, which requires data to be
1852+
called before.
1853+
The StataReader supports .dta Formats 104, 105, 108, 113-115.
1854+
1855+
Alternatively, the function :func:'~pandas.io.read_stata' can be used:
1856+
1857+
.. ipython:: python
1858+
dataframe = read_stata(dta_filepath)
1859+
1860+
1861+
Writing to STATA format
1862+
~~~~~~~~~~~~~~~~~~~~~~
1863+
1864+
.. _io.StataWriter:
1865+
1866+
The function :func:'~pandas.io.StataWriter.write_file' will write a DataFrame
1867+
into a .dta file. The format version of this file is always the latest one,
1868+
115.
1869+
1870+
.. ipython:: python
1871+
writer = StataWriter(filename, dataframe)
1872+
writer.write_file()

doc/source/v0.11.1.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ Enhancements
5454
- support datelike columns with a timezone as data_columns (GH2852_)
5555
- ``fillna`` methods now raise a ``TypeError`` if the ``value`` parameter is
5656
a list or tuple.
57+
- Added module for reading and writing Stata files: pandas.io.stata (GH1512_)
5758

5859
See the `full release notes
5960
<https://github.com/pydata/pandas/blob/master/RELEASE.rst>`__ or issue tracker
@@ -68,3 +69,4 @@ on GitHub for a complete list.
6869
.. _GH3596: https://github.com/pydata/pandas/issues/3596
6970
.. _GH3590: https://github.com/pydata/pandas/issues/3590
7071
.. _GH3435: https://github.com/pydata/pandas/issues/3435
72+
.. _GH1512: https://github.com/pydata/pandas/issues/1512

0 commit comments

Comments
 (0)