Skip to content

Commit 185db96

Browse files
committed
Updating documentation. Adding unit test
1 parent 236d89b commit 185db96

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

doc/source/whatsnew/v3.0.0.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,11 @@ Other enhancements
4545
- :meth:`DataFrame.fillna` and :meth:`Series.fillna` can now accept ``value=None``; for non-object dtype the corresponding NA value will be used (:issue:`57723`)
4646
- :meth:`DataFrame.pivot_table` and :func:`pivot_table` now allow the passing of keyword arguments to ``aggfunc`` through ``**kwargs`` (:issue:`57884`)
4747
- :meth:`Series.cummin` and :meth:`Series.cummax` now supports :class:`CategoricalDtype` (:issue:`52335`)
48+
- :meth:`Series.dt.day_of_week` now returns ``int8`` dtype (:issue:`58185`)
4849
- :meth:`Series.plot` now correctly handle the ``ylabel`` parameter for pie charts, allowing for explicit control over the y-axis label (:issue:`58239`)
4950
- Restore support for reading Stata 104-format and enable reading 103-format dta files (:issue:`58554`)
5051
- Support reading Stata 110-format (Stata 7) dta files (:issue:`47176`)
51-
52+
-
5253
.. ---------------------------------------------------------------------------
5354
.. _whatsnew_300.notable_bug_fixes:
5455

pandas/tests/series/accessors/test_dt_accessor.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,12 @@ def test_dt_namespace_accessor_datetime64(self, freq):
136136
expected = Series(exp_values, index=ser.index, name="xxx")
137137
tm.assert_series_equal(result, expected)
138138

139+
def test_day_of_week_return_type(self):
140+
ser = Series(
141+
["2024-01-01", "2024-01-02", "2024-01-03"], dtype="datetime64[us]"
142+
).dt.day_of_week
143+
assert ser.dtype == "int8"
144+
139145
def test_dt_namespace_accessor_datetime64tz(self):
140146
# GH#7207, GH#11128
141147
# test .dt namespace accessor

0 commit comments

Comments
 (0)