Skip to content

Commit 3bc2831

Browse files
saurav-chakravortydatapythonista
authored andcommitted
DOC: Use a standard header for all rst files (#24086)
1 parent 949b148 commit 3bc2831

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+369
-338
lines changed

doc/source/10min.rst

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,6 @@
11
.. _10min:
22

3-
.. currentmodule:: pandas
4-
5-
.. ipython:: python
6-
:suppress:
7-
8-
import os
9-
import numpy as np
10-
11-
import pandas as pd
12-
13-
np.random.seed(123456)
14-
np.set_printoptions(precision=4, suppress=True)
15-
pd.options.display.max_rows = 15
16-
17-
# portions of this were borrowed from the
18-
# Pandas cheatsheet
19-
# created during the PyData Workshop-Sprint 2012
20-
# Hannah Chen, Henry Chow, Eric Cox, Robert Mauriello
21-
3+
{{ header }}
224

235
********************
246
10 Minutes to pandas
@@ -773,6 +755,7 @@ CSV
773755
.. ipython:: python
774756
:suppress:
775757
758+
import os
776759
os.remove('foo.csv')
777760
778761
HDF5

doc/source/advanced.rst

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
.. _advanced:
22

3-
.. currentmodule:: pandas
4-
5-
.. ipython:: python
6-
:suppress:
7-
8-
import numpy as np
9-
import pandas as pd
10-
np.random.seed(123456)
11-
np.set_printoptions(precision=4, suppress=True)
12-
pd.options.display.max_rows = 15
3+
{{ header }}
134

145
******************************
156
MultiIndex / Advanced Indexing

doc/source/basics.rst

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
1-
.. currentmodule:: pandas
2-
3-
.. ipython:: python
4-
:suppress:
5-
6-
import numpy as np
7-
import pandas as pd
8-
9-
np.set_printoptions(precision=4, suppress=True)
10-
pd.options.display.max_rows = 15
11-
121
.. _basics:
132

3+
{{ header }}
4+
145
==============================
156
Essential Basic Functionality
167
==============================

doc/source/categorical.rst

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,6 @@
11
.. _categorical:
22

3-
.. currentmodule:: pandas
4-
5-
.. ipython:: python
6-
:suppress:
7-
8-
import numpy as np
9-
import pandas as pd
10-
np.random.seed(123456)
11-
np.set_printoptions(precision=4, suppress=True)
12-
pd.options.display.max_rows = 15
13-
3+
{{ header }}
144

155
****************
166
Categorical Data

doc/source/comparison_with_r.rst

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
1-
.. currentmodule:: pandas
21
.. _compare_with_r:
32

4-
.. ipython:: python
5-
:suppress:
6-
7-
import pandas as pd
8-
import numpy as np
9-
pd.options.display.max_rows = 15
3+
{{ header }}
104

115
Comparison with R / R libraries
126
*******************************

doc/source/comparison_with_sas.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
.. currentmodule:: pandas
21
.. _compare_with_sas:
32

3+
{{ header }}
4+
45
Comparison with SAS
56
********************
67
For potential users coming from `SAS <https://en.wikipedia.org/wiki/SAS_(software)>`__

doc/source/comparison_with_sql.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
.. currentmodule:: pandas
21
.. _compare_with_sql:
32

3+
{{ header }}
4+
45
Comparison with SQL
56
********************
67
Since many potential pandas users have some familiarity with

doc/source/comparison_with_stata.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
.. currentmodule:: pandas
21
.. _compare_with_stata:
32

3+
{{ header }}
4+
45
Comparison with Stata
56
*********************
67
For potential users coming from `Stata <https://en.wikipedia.org/wiki/Stata>`__
@@ -675,5 +676,3 @@ If out of core processing is needed, one possibility is the
675676
`dask.dataframe <http://dask.pydata.org/en/latest/dataframe.html>`_
676677
library, which provides a subset of pandas functionality for an
677678
on-disk ``DataFrame``.
678-
679-

doc/source/computation.rst

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,7 @@
1-
.. currentmodule:: pandas
2-
3-
.. ipython:: python
4-
:suppress:
5-
6-
import numpy as np
7-
import matplotlib.pyplot as plt
8-
9-
import pandas as pd
10-
11-
np.random.seed(123456)
12-
np.set_printoptions(precision=4, suppress=True)
13-
pd.options.display.max_rows = 15
14-
15-
plt.close('all')
16-
171
.. _computation:
182

3+
{{ header }}
4+
195
Computational tools
206
===================
217

doc/source/conf.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -301,25 +301,25 @@
301301
}
302302

303303

304-
common_imports = """\
304+
header = """\
305305
.. currentmodule:: pandas
306306
307307
.. ipython:: python
308308
:suppress:
309309
310310
import numpy as np
311-
from pandas import *
312311
import pandas as pd
312+
313313
randn = np.random.randn
314+
np.random.seed(123456)
314315
np.set_printoptions(precision=4, suppress=True)
315-
options.display.max_rows = 15
316-
from pandas.compat import StringIO
316+
pd.options.display.max_rows = 15
317317
"""
318318

319319

320320
html_context = {
321321
'redirects': {old: new for old, new in moved_api_pages},
322-
'common_imports': common_imports,
322+
'header': header
323323
}
324324

325325
# If false, no module index is generated.

0 commit comments

Comments
 (0)