File tree 3 files changed +45
-0
lines changed
3 files changed +45
-0
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ pandas 0.11.1
33
33
- pd.read_html() can now parse HTML string, files or urls and return dataframes
34
34
courtesy of @cpcloud. (GH3477 _)
35
35
- Support for reading Amazon S3 files. (GH3504 _)
36
+ - Added module for reading and writing Stata files: pandas.io.stata (GH1512 _)
36
37
37
38
**Improvements to existing features **
38
39
@@ -166,6 +167,7 @@ pandas 0.11.1
166
167
.. _GH3610 : https://github.com/pydata/pandas/issues/3610
167
168
.. _GH3596 : https://github.com/pydata/pandas/issues/3596
168
169
.. _GH3435 : https://github.com/pydata/pandas/issues/3435
170
+ .. _GH1512 : https://github.com/pydata/pandas/issues/1512
169
171
170
172
171
173
pandas 0.11.0
Original file line number Diff line number Diff line change @@ -1829,3 +1829,44 @@ There are a few other available functions:
1829
1829
1830
1830
For now, writing your DataFrame into a database works only with
1831
1831
**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()
Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ Enhancements
54
54
- support datelike columns with a timezone as data_columns (GH2852_)
55
55
- ``fillna`` methods now raise a ``TypeError`` if the ``value`` parameter is
56
56
a list or tuple.
57
+ - Added module for reading and writing Stata files: pandas.io.stata (GH1512_)
57
58
58
59
See the `full release notes
59
60
<https://github.com/pydata/pandas/blob/master/RELEASE.rst>`__ or issue tracker
@@ -68,3 +69,4 @@ on GitHub for a complete list.
68
69
.. _GH3596: https://github.com/pydata/pandas/issues/3596
69
70
.. _GH3590: https://github.com/pydata/pandas/issues/3590
70
71
.. _GH3435: https://github.com/pydata/pandas/issues/3435
72
+ .. _GH1512: https://github.com/pydata/pandas/issues/1512
You can’t perform that action at this time.
0 commit comments