Skip to content

Commit 6dfa838

Browse files
jorisvandenbosschePingviinituutti
authored andcommitted
DOC: fix some doc build warnings/errors (pandas-dev#24552)
1 parent b01d740 commit 6dfa838

File tree

7 files changed

+13
-17
lines changed

7 files changed

+13
-17
lines changed

doc/source/cookbook.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1236,7 +1236,7 @@ the following Python code will read the binary file ``'binary.dat'`` into a
12361236
pandas ``DataFrame``, where each element of the struct corresponds to a column
12371237
in the frame:
12381238

1239-
.. ipython:: python
1239+
.. code-block:: python
12401240
12411241
names = 'count', 'avg', 'scale'
12421242

doc/source/integer_na.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
{{ header }}
44

5-
.. _integer_na:
5+
.. _integer_na:
66

77
**************************
88
Nullable Integer Data Type

doc/source/io.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -4880,7 +4880,7 @@ below and the SQLAlchemy `documentation <https://docs.sqlalchemy.org/en/latest/c
48804880
48814881
If you want to manage your own connections you can pass one of those instead:
48824882

4883-
.. ipython:: python
4883+
.. code-block:: python
48844884
48854885
with engine.connect() as conn, conn.begin():
48864886
data = pd.read_sql_table('data', conn)

doc/source/missing_data.rst

+2-7
Original file line numberDiff line numberDiff line change
@@ -759,12 +759,7 @@ the ``dtype="Int64"``.
759759

760760
.. ipython:: python
761761
762-
s = pd.Series(np.random.randn(5), index=[0, 2, 4, 6, 7],
763-
dtype="Int64")
764-
s > 0
765-
(s > 0).dtype
766-
crit = (s > 0).reindex(list(range(8)))
767-
crit
768-
crit.dtype
762+
s = pd.Series([0, 1, np.nan, 3, 4], dtype="Int64")
763+
s
769764
770765
See :ref:`integer_na` for more.

doc/source/timeseries.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -1874,16 +1874,16 @@ has multiplied span.
18741874

18751875
.. ipython:: python
18761876
1877-
pd.PeriodIndex(start='2014-01', freq='3M', periods=4)
1877+
pd.period_range(start='2014-01', freq='3M', periods=4)
18781878
18791879
If ``start`` or ``end`` are ``Period`` objects, they will be used as anchor
18801880
endpoints for a ``PeriodIndex`` with frequency matching that of the
18811881
``PeriodIndex`` constructor.
18821882

18831883
.. ipython:: python
18841884
1885-
pd.PeriodIndex(start=pd.Period('2017Q1', freq='Q'),
1886-
end=pd.Period('2017Q2', freq='Q'), freq='M')
1885+
pd.period_range(start=pd.Period('2017Q1', freq='Q'),
1886+
end=pd.Period('2017Q2', freq='Q'), freq='M')
18871887
18881888
Just like ``DatetimeIndex``, a ``PeriodIndex`` can also be used to index pandas
18891889
objects:

doc/source/tutorials.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ repository <http://github.com/jvns/pandas-cookbook>`_.
3333
Learn Pandas by Hernan Rojas
3434
----------------------------
3535

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

3838
Practical data analysis with Python
3939
-----------------------------------

doc/source/whatsnew/v0.20.0.rst

+4-3
Original file line numberDiff line numberDiff line change
@@ -189,14 +189,15 @@ URLs and paths are now inferred using their file extensions. Additionally,
189189
support for bz2 compression in the python 2 C-engine improved (:issue:`14874`).
190190

191191
.. ipython:: python
192-
:okwarning:
193192
194193
url = ('https://github.com/{repo}/raw/{branch}/{path}'
195194
.format(repo='pandas-dev/pandas',
196195
branch='master',
197196
path='pandas/tests/io/parser/data/salaries.csv.bz2'))
198-
df = pd.read_table(url, compression='infer') # default, infer compression
199-
df = pd.read_table(url, compression='bz2') # explicitly specify compression
197+
# default, infer compression
198+
df = pd.read_csv(url, sep='\t', compression='infer')
199+
# explicitly specify compression
200+
df = pd.read_csv(url, sep='\t', compression='bz2')
200201
df.head(2)
201202
202203
.. _whatsnew_0200.enhancements.pickle_compression:

0 commit comments

Comments
 (0)