Skip to content

DOC: some general doc/sphinx fixes #13740

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

Merged
merged 4 commits into from
Jul 21, 2016
Merged
Show file tree
Hide file tree
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
16 changes: 7 additions & 9 deletions doc/source/computation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we still have * imports anywhere? (otherwise this should have broken)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was broken :-) (as I noticed in the travis doc build log, otherwise I wouldn't have catched this)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

haha, makes sense! good that these raise (though didn't seem to fail the travis build) :<

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, currently the travis build does not fail for such errors. But in principle we could do a search for certain patterns in the doc build log and let travis fail based on that

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()

Expand Down
6 changes: 3 additions & 3 deletions doc/source/ecosystem.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Statistics and Machine Learning
-------------------------------

`Statsmodels <http://www.statsmodels.org/>`__
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Statsmodels is the prominent python "statistics and econometrics library" and it has
a long-standing special relationship with pandas. Statsmodels provides powerful statistics,
Expand Down Expand Up @@ -78,7 +78,7 @@ more advanced types of plots then those offered by pandas.

The `Vincent <https://github.com/wrobstory/vincent>`__ project leverages `Vega <https://github.com/trifacta/vega>`__
(that in turn, leverages `d3 <http://d3js.org/>`__) 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 <https://github.com/wrobstory/vincent#2015-08-12-update>`__.

`IPython Vega <https://github.com/vega/ipyvega>`__
Expand Down Expand Up @@ -130,7 +130,7 @@ qgrid is "an interactive grid for sorting and filtering
DataFrames in IPython Notebook" built with SlickGrid.

`Spyder <https://github.com/spyder-ide/spyder/>`__
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Spyder is a cross-platform Qt-based open-source Python IDE with
editing, testing, debugging, and introspection features.
Expand Down
46 changes: 39 additions & 7 deletions doc/source/whatsnew/v0.15.1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 <remote_data.yahoo_options>`

Expand Down
2 changes: 1 addition & 1 deletion doc/source/whatsnew/v0.17.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 <timeseries.legacyaliases>` 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`).

Expand Down
3 changes: 1 addition & 2 deletions doc/source/whatsnew/v0.8.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 <merging.ordered_merge>` function
- New :ref:`ordered_merge <merging.merge_ordered>` function
- Add flexible :ref:`comparison <basics.binop>` instance methods eq, ne, lt,
gt, etc. to DataFrame, Series
- Improve :ref:`scatter_matrix <visualization.scatter_matrix>` plotting
Expand Down Expand Up @@ -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.

26 changes: 14 additions & 12 deletions pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -1476,28 +1476,28 @@ 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
Default is latin-1. Unicode is not supported
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
------
Expand All @@ -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)
Expand Down
5 changes: 2 additions & 3 deletions pandas/io/stata.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pandas/io/tests/test_stata.py
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down