Skip to content

Commit 0ec1aaa

Browse files
committed
details on weekday argument for DateOffset docs
1 parent c92b370 commit 0ec1aaa

File tree

4 files changed

+47
-8
lines changed

4 files changed

+47
-8
lines changed

doc/books.xml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<bookstore>
3+
<book category="cooking">
4+
<title lang="en">Everyday Italian</title>
5+
<author>Giada De Laurentiis</author>
6+
<year>2005</year>
7+
<price>30.00</price>
8+
</book>
9+
<book category="children">
10+
<title lang="en">Harry Potter</title>
11+
<author>J K. Rowling</author>
12+
<year>2005</year>
13+
<price>29.99</price>
14+
</book>
15+
<book category="web">
16+
<title lang="en">Learning XML</title>
17+
<author>Erik T. Ray</author>
18+
<year>2003</year>
19+
<price>39.95</price>
20+
</book>
21+
</bookstore>

doc/source/getting_started/intro_tutorials/04_plotting.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ How do I create plots in pandas?
4949
I want a quick visual check of the data.
5050

5151
.. ipython:: python
52-
52+
:okwarning:
5353
@savefig 04_airqual_quick.png
5454
air_quality.plot()
5555
plt.show()
@@ -78,7 +78,7 @@ I want to plot only the columns of the data table with the data from Paris.
7878
plt.clf()
7979
8080
.. ipython:: python
81-
81+
:okwarning:
8282
@savefig 04_airqual_paris.png
8383
air_quality["station_paris"].plot()
8484
plt.show()
@@ -101,7 +101,7 @@ method. Hence, the :meth:`~DataFrame.plot` method works on both ``Series`` and
101101
I want to visually compare the :math:`NO_2` values measured in London versus Paris.
102102

103103
.. ipython:: python
104-
104+
:okwarning:
105105
@savefig 04_airqual_scatter.png
106106
air_quality.plot.scatter(x="station_london", y="station_paris", alpha=0.5)
107107
plt.show()
@@ -133,7 +133,7 @@ One of the options is :meth:`DataFrame.plot.box`, which refers to a
133133
method is applicable on the air quality example data:
134134

135135
.. ipython:: python
136-
136+
:okwarning:
137137
@savefig 04_airqual_boxplot.png
138138
air_quality.plot.box()
139139
plt.show()
@@ -157,7 +157,7 @@ For an introduction to plots other than the default line plot, see the user guid
157157
I want each of the columns in a separate subplot.
158158

159159
.. ipython:: python
160-
160+
:okwarning:
161161
@savefig 04_airqual_area_subplot.png
162162
axs = air_quality.plot.area(figsize=(12, 4), subplots=True)
163163
plt.show()
@@ -190,7 +190,7 @@ Some more formatting options are explained in the user guide section on :ref:`pl
190190
I want to further customize, extend or save the resulting plot.
191191

192192
.. ipython:: python
193-
193+
:okwarning:
194194
fig, axs = plt.subplots(figsize=(12, 4))
195195
air_quality.plot.area(ax=axs)
196196
axs.set_ylabel("NO$_2$ concentration")
@@ -200,7 +200,7 @@ I want to further customize, extend or save the resulting plot.
200200
201201
.. ipython:: python
202202
:suppress:
203-
203+
:okwarning:
204204
import os
205205
206206
os.remove("no2_concentrations.png")

doc/source/user_guide/10min.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,7 @@ If running under Jupyter Notebook, the plot will appear on :meth:`~Series.plot`.
747747
`matplotlib.pyplot.savefig <https://matplotlib.org/3.1.1/api/_as_gen/matplotlib.pyplot.savefig.html>`__ to write it to a file.
748748

749749
.. ipython:: python
750-
750+
:okwarning:
751751
plt.show();
752752
753753
On a DataFrame, the :meth:`~DataFrame.plot` method is a convenience to plot all

pandas/_libs/tslibs/offsets.pyx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1373,7 +1373,25 @@ class DateOffset(RelativeDeltaOffset, metaclass=OffsetMeta):
13731373
previous midnight.
13741374
**kwds
13751375
Temporal parameter that add to or replace the offset value.
1376+
weekday : int {0, 1, ..., 6}, default 0
1377+
A specific integer for the day of the week.
1378+
- 0 is Monday
1379+
- 1 is Tuesday
1380+
- 2 is Wednesday
1381+
- 3 is Thursday
1382+
- 4 is Friday
1383+
- 5 is Saturday
1384+
- 6 is Sunday.
13761385
1386+
Instead Weekday type from dateutil.relativedelta can be used.
1387+
- MO is Monday
1388+
- TU is Tuesday
1389+
- WE is Wednesday
1390+
- TH is Thursday
1391+
- FR is Friday
1392+
- SA is Saturday
1393+
- SU is Sunday.
1394+
13771395
Parameters that **add** to the offset (like Timedelta):
13781396
13791397
- years

0 commit comments

Comments
 (0)