diff --git a/doc/source/computation.rst b/doc/source/computation.rst
index 12e0ecfba97da..1414d2dd3c8dc 100644
--- a/doc/source/computation.rst
+++ b/doc/source/computation.rst
@@ -428,15 +428,13 @@ Using a non-regular, but still monotonic index, rolling with an integer window d
.. ipython:: python
-
- dft = DataFrame({'B': [0, 1, 2, np.nan, 4]},
- index = pd.Index([pd.Timestamp('20130101 09:00:00'),
- pd.Timestamp('20130101 09:00:02'),
- pd.Timestamp('20130101 09:00:03'),
- pd.Timestamp('20130101 09:00:05'),
- pd.Timestamp('20130101 09:00:06')],
- name='foo'))
-
+ dft = pd.DataFrame({'B': [0, 1, 2, np.nan, 4]},
+ index = pd.Index([pd.Timestamp('20130101 09:00:00'),
+ pd.Timestamp('20130101 09:00:02'),
+ pd.Timestamp('20130101 09:00:03'),
+ pd.Timestamp('20130101 09:00:05'),
+ pd.Timestamp('20130101 09:00:06')],
+ name='foo'))
dft
dft.rolling(2).sum()
diff --git a/doc/source/ecosystem.rst b/doc/source/ecosystem.rst
index 0d010b47f393a..17ebd1f163f4f 100644
--- a/doc/source/ecosystem.rst
+++ b/doc/source/ecosystem.rst
@@ -25,7 +25,7 @@ Statistics and Machine Learning
-------------------------------
`Statsmodels `__
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Statsmodels is the prominent python "statistics and econometrics library" and it has
a long-standing special relationship with pandas. Statsmodels provides powerful statistics,
@@ -78,7 +78,7 @@ more advanced types of plots then those offered by pandas.
The `Vincent `__ project leverages `Vega `__
(that in turn, leverages `d3 `__) to create
-plots. Although functional, as of Summer 2016 the Vincent project has not been updated
+plots. Although functional, as of Summer 2016 the Vincent project has not been updated
in over two years and is `unlikely to receive further updates `__.
`IPython Vega `__
@@ -130,7 +130,7 @@ qgrid is "an interactive grid for sorting and filtering
DataFrames in IPython Notebook" built with SlickGrid.
`Spyder `__
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Spyder is a cross-platform Qt-based open-source Python IDE with
editing, testing, debugging, and introspection features.
diff --git a/doc/source/whatsnew/v0.15.1.txt b/doc/source/whatsnew/v0.15.1.txt
index 2a4104c2d5dc4..a25e5a80b65fc 100644
--- a/doc/source/whatsnew/v0.15.1.txt
+++ b/doc/source/whatsnew/v0.15.1.txt
@@ -144,14 +144,46 @@ API changes
Current behavior:
- .. ipython:: python
- :okwarning:
+ .. code-block:: ipython
- from pandas.io.data import Options
- aapl = Options('aapl','yahoo')
- aapl.get_call_data().iloc[0:5,0:1]
- aapl.expiry_dates
- aapl.get_near_stock_price(expiry=aapl.expiry_dates[0:3]).iloc[0:5,0:1]
+ In [17]: from pandas.io.data import Options
+
+ In [18]: aapl = Options('aapl','yahoo')
+
+ In [19]: aapl.get_call_data().iloc[0:5,0:1]
+ Out[19]:
+ Last
+ Strike Expiry Type Symbol
+ 80 2014-11-14 call AAPL141114C00080000 29.05
+ 84 2014-11-14 call AAPL141114C00084000 24.80
+ 85 2014-11-14 call AAPL141114C00085000 24.05
+ 86 2014-11-14 call AAPL141114C00086000 22.76
+ 87 2014-11-14 call AAPL141114C00087000 21.74
+
+ In [20]: aapl.expiry_dates
+ Out[20]:
+ [datetime.date(2014, 11, 14),
+ datetime.date(2014, 11, 22),
+ datetime.date(2014, 11, 28),
+ datetime.date(2014, 12, 5),
+ datetime.date(2014, 12, 12),
+ datetime.date(2014, 12, 20),
+ datetime.date(2015, 1, 17),
+ datetime.date(2015, 2, 20),
+ datetime.date(2015, 4, 17),
+ datetime.date(2015, 7, 17),
+ datetime.date(2016, 1, 15),
+ datetime.date(2017, 1, 20)]
+
+ In [21]: aapl.get_near_stock_price(expiry=aapl.expiry_dates[0:3]).iloc[0:5,0:1]
+ Out[21]:
+ Last
+ Strike Expiry Type Symbol
+ 109 2014-11-22 call AAPL141122C00109000 1.48
+ 2014-11-28 call AAPL141128C00109000 1.79
+ 110 2014-11-14 call AAPL141114C00110000 0.55
+ 2014-11-22 call AAPL141122C00110000 1.02
+ 2014-11-28 call AAPL141128C00110000 1.32
See the Options documentation in :ref:`Remote Data `
diff --git a/doc/source/whatsnew/v0.17.0.txt b/doc/source/whatsnew/v0.17.0.txt
index ef9785d25f014..fc13224d3fe6e 100644
--- a/doc/source/whatsnew/v0.17.0.txt
+++ b/doc/source/whatsnew/v0.17.0.txt
@@ -965,7 +965,7 @@ Deprecations
- ``TimeSeries`` deprecated in favor of ``Series`` (note that this has been an alias since 0.13.0), (:issue:`10890`)
- ``SparsePanel`` deprecated and will be removed in a future version (:issue:`11157`).
- ``Series.is_time_series`` deprecated in favor of ``Series.index.is_all_dates`` (:issue:`11135`)
-- Legacy offsets (like ``'A@JAN'``) listed in :ref:`here ` are deprecated (note that this has been alias since 0.8.0), (:issue:`10878`)
+- Legacy offsets (like ``'A@JAN'``) are deprecated (note that this has been alias since 0.8.0) (:issue:`10878`)
- ``WidePanel`` deprecated in favor of ``Panel``, ``LongPanel`` in favor of ``DataFrame`` (note these have been aliases since < 0.11.0), (:issue:`10892`)
- ``DataFrame.convert_objects`` has been deprecated in favor of type-specific functions ``pd.to_datetime``, ``pd.to_timestamp`` and ``pd.to_numeric`` (new in 0.17.0) (:issue:`11133`).
diff --git a/doc/source/whatsnew/v0.8.0.txt b/doc/source/whatsnew/v0.8.0.txt
index 0d2cfeb2d7cfc..cf6ac7c1e6ad2 100644
--- a/doc/source/whatsnew/v0.8.0.txt
+++ b/doc/source/whatsnew/v0.8.0.txt
@@ -134,7 +134,7 @@ Other new features
- Move to klib-based hash tables for indexing; better performance and less
memory usage than Python's dict
- Add first, last, min, max, and prod optimized GroupBy functions
-- New :ref:`ordered_merge ` function
+- New :ref:`ordered_merge ` function
- Add flexible :ref:`comparison ` instance methods eq, ne, lt,
gt, etc. to DataFrame, Series
- Improve :ref:`scatter_matrix ` plotting
@@ -271,4 +271,3 @@ unique. In many cases it will no longer fail (some method like ``append`` still
check for uniqueness unless disabled). However, all is not lost: you can
inspect ``index.is_unique`` and raise an exception explicitly if it is
``False`` or go to a different code branch.
-
diff --git a/pandas/core/frame.py b/pandas/core/frame.py
index a59668320de3d..558d3b1885bf5 100644
--- a/pandas/core/frame.py
+++ b/pandas/core/frame.py
@@ -1476,12 +1476,12 @@ def to_stata(self, fname, convert_dates=None, write_index=True,
fname : str or buffer
String path of file-like object
convert_dates : dict
- Dictionary mapping columns containing datetime types to stata internal
- format to use when wirting the dates. Options are 'tc', 'td', 'tm',
- 'tw', 'th', 'tq', 'ty'. Column can be either an integer or a name.
- Datetime columns that do not have a conversion type specified will be
- converted to 'tc'. Raises NotImplementedError if a datetime column has
- timezone information
+ Dictionary mapping columns containing datetime types to stata
+ internal format to use when wirting the dates. Options are 'tc',
+ 'td', 'tm', 'tw', 'th', 'tq', 'ty'. Column can be either an integer
+ or a name. Datetime columns that do not have a conversion type
+ specified will be converted to 'tc'. Raises NotImplementedError if
+ a datetime column has timezone information
write_index : bool
Write the index to Stata dataset.
encoding : str
@@ -1489,15 +1489,15 @@ def to_stata(self, fname, convert_dates=None, write_index=True,
byteorder : str
Can be ">", "<", "little", or "big". default is `sys.byteorder`
time_stamp : datetime
- A datetime to use as file creation date. Default is the current time
+ A datetime to use as file creation date. Default is the current
+ time.
dataset_label : str
A label for the data set. Must be 80 characters or smaller.
-
- .. versionadded:: 0.19.0
-
variable_labels : dict
- Dictionary containing columns as keys and variable labels as values.
- Each label must be 80 characters or smaller.
+ Dictionary containing columns as keys and variable labels as
+ values. Each label must be 80 characters or smaller.
+
+ .. versionadded:: 0.19.0
Raises
------
@@ -1510,6 +1510,8 @@ def to_stata(self, fname, convert_dates=None, write_index=True,
* Column listed in convert_dates is not in DataFrame
* Categorical label contains more than 32,000 characters
+ .. versionadded:: 0.19.0
+
Examples
--------
>>> writer = StataWriter('./data_file.dta', data)
diff --git a/pandas/io/stata.py b/pandas/io/stata.py
index 68a723d399c27..59bc24acac6f8 100644
--- a/pandas/io/stata.py
+++ b/pandas/io/stata.py
@@ -1829,13 +1829,12 @@ class StataWriter(StataParser):
A datetime to use as file creation date. Default is the current time
dataset_label : str
A label for the data set. Must be 80 characters or smaller.
-
- .. versionadded:: 0.19.0
-
variable_labels : dict
Dictionary containing columns as keys and variable labels as values.
Each label must be 80 characters or smaller.
+ .. versionadded:: 0.19.0
+
Returns
-------
writer : StataWriter instance
diff --git a/pandas/io/tests/test_stata.py b/pandas/io/tests/test_stata.py
index 009e40c84f94b..2e3182b69acaf 100644
--- a/pandas/io/tests/test_stata.py
+++ b/pandas/io/tests/test_stata.py
@@ -1204,7 +1204,7 @@ def test_unsupported_datetype(self):
with tm.ensure_clean() as path:
original.to_stata(path, convert_dates={'dates': 'tC'})
- dates = pd.date_range('1-1-1990',periods=3,tz='Asia/Hong_Kong')
+ dates = pd.date_range('1-1-1990', periods=3, tz='Asia/Hong_Kong')
original = pd.DataFrame({'nums': [1.0, 2.0, 3.0],
'strs': ['apple', 'banana', 'cherry'],
'dates': dates})