Skip to content

DOC: fix some doc build warnings/errors #24552

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 2 commits into from
Jan 2, 2019
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
2 changes: 1 addition & 1 deletion doc/source/cookbook.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1236,7 +1236,7 @@ the following Python code will read the binary file ``'binary.dat'`` into a
pandas ``DataFrame``, where each element of the struct corresponds to a column
in the frame:

.. ipython:: python
.. code-block:: python

names = 'count', 'avg', 'scale'

Expand Down
2 changes: 1 addition & 1 deletion doc/source/integer_na.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{{ header }}

.. _integer_na:
.. _integer_na:

**************************
Nullable Integer Data Type
Expand Down
2 changes: 1 addition & 1 deletion doc/source/io.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4880,7 +4880,7 @@ below and the SQLAlchemy `documentation <https://docs.sqlalchemy.org/en/latest/c

If you want to manage your own connections you can pass one of those instead:

.. ipython:: python
.. code-block:: python

with engine.connect() as conn, conn.begin():
data = pd.read_sql_table('data', conn)
Expand Down
9 changes: 2 additions & 7 deletions doc/source/missing_data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -759,12 +759,7 @@ the ``dtype="Int64"``.

.. ipython:: python

s = pd.Series(np.random.randn(5), index=[0, 2, 4, 6, 7],
dtype="Int64")
s > 0
(s > 0).dtype
crit = (s > 0).reindex(list(range(8)))
crit
crit.dtype
Copy link
Member Author

Choose a reason for hiding this comment

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

@TomAugspurger was there something specific you wanted to show with the above code? It seems you copied this from above about booleans becoming object, but which doesn't seem relevant for integer NA

(the actual fix here is the first line, you can't convert floats from random.randn to Integers)

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't recall anything specific goal behind that example.

s = pd.Series([0, 1, np.nan, 3, 4], dtype="Int64")
s

See :ref:`integer_na` for more.
6 changes: 3 additions & 3 deletions doc/source/timeseries.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1874,16 +1874,16 @@ has multiplied span.

.. ipython:: python

pd.PeriodIndex(start='2014-01', freq='3M', periods=4)
pd.period_range(start='2014-01', freq='3M', periods=4)

If ``start`` or ``end`` are ``Period`` objects, they will be used as anchor
endpoints for a ``PeriodIndex`` with frequency matching that of the
``PeriodIndex`` constructor.

.. ipython:: python

pd.PeriodIndex(start=pd.Period('2017Q1', freq='Q'),
end=pd.Period('2017Q2', freq='Q'), freq='M')
pd.period_range(start=pd.Period('2017Q1', freq='Q'),
end=pd.Period('2017Q2', freq='Q'), freq='M')

Just like ``DatetimeIndex``, a ``PeriodIndex`` can also be used to index pandas
objects:
Expand Down
2 changes: 1 addition & 1 deletion doc/source/tutorials.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ repository <http://github.com/jvns/pandas-cookbook>`_.
Learn Pandas by Hernan Rojas
----------------------------

A set of lesson for new pandas users: `Learn pandas <https://bitbucket.org/hrojas/learn-pandas>`__.
A set of lesson for new pandas users: https://bitbucket.org/hrojas/learn-pandas

Practical data analysis with Python
-----------------------------------
Expand Down
7 changes: 4 additions & 3 deletions doc/source/whatsnew/v0.20.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,15 @@ URLs and paths are now inferred using their file extensions. Additionally,
support for bz2 compression in the python 2 C-engine improved (:issue:`14874`).

.. ipython:: python
:okwarning:

url = ('https://github.com/{repo}/raw/{branch}/{path}'
.format(repo='pandas-dev/pandas',
branch='master',
path='pandas/tests/io/parser/data/salaries.csv.bz2'))
df = pd.read_table(url, compression='infer') # default, infer compression
df = pd.read_table(url, compression='bz2') # explicitly specify compression
# default, infer compression
df = pd.read_csv(url, sep='\t', compression='infer')
# explicitly specify compression
df = pd.read_csv(url, sep='\t', compression='bz2')
df.head(2)

.. _whatsnew_0200.enhancements.pickle_compression:
Expand Down