day_of_year
State: closed

- [ ] closes #9606
- [ ] tests added / passed
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry


Labels:
name: Datetime
description: Datetime data dtype
name: API Design
name: Deprecate
description: Functionality to remove in pandas

Comments:
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/25924?src=pr&el=h1) Report
> Merging [#25924](https://codecov.io/gh/pandas-dev/pandas/pull/25924?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/437efa6e974e506c7cc5f142d5186bf6a7f5ce13?src=pr&el=desc) will **decrease** coverage by `<.01%`.
> The diff coverage is `100%`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/25924/graphs/tree.svg?width=650&token=eZ4WkYLtcO&height=150&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/25924?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master   #25924      +/-   ##
==========================================
- Coverage   91.85%   91.85%   -0.01%     
==========================================
  Files         174      174              
  Lines       50722    50722              
==========================================
- Hits        46593    46589       -4     
- Misses       4129     4133       +4
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.39% <100%> (ø)` | :arrow_up: |
| #single | `41.78% <100%> (-0.09%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/25924?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/indexes/period.py](https://codecov.io/gh/pandas-dev/pandas/pull/25924/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9wZXJpb2QucHk=) | `92.58% <ø> (ø)` | :arrow_up: |
| [pandas/core/indexes/datetimes.py](https://codecov.io/gh/pandas-dev/pandas/pull/25924/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9kYXRldGltZXMucHk=) | `96.36% <ø> (ø)` | :arrow_up: |
| [pandas/core/arrays/period.py](https://codecov.io/gh/pandas-dev/pandas/pull/25924/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL3BlcmlvZC5weQ==) | `98.53% <100%> (ø)` | :arrow_up: |
| [pandas/core/arrays/datetimes.py](https://codecov.io/gh/pandas-dev/pandas/pull/25924/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL2RhdGV0aW1lcy5weQ==) | `97.79% <100%> (ø)` | :arrow_up: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/25924/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `78.94% <0%> (-10.53%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/25924/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97% <0%> (-0.12%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/25924?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/25924?src=pr&el=footer). Last update [437efa6...558f804](https://codecov.io/gh/pandas-dev/pandas/pull/25924?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

`dayofyear` cannot be directly replaced with `day_of_year ` all at once. A new `day_of_year` method needs to be created first and then `dayofyear` needs a deprecation warning (all of which can be done in this PR). If you could do the same with `dayofweek` that'd be great.
@mroeschke thank you for your feedback.
TODO:
- [ ] deprecation warnings
- [ ] dayofweek
Hello @mroeschke , 
I'm a new comer to Pandas, I notice there're other timeseries accessors like 'weekofyear'. MDo you want me to work on it?
Thank you. 

Thanks for the interest @Violet-XiaoWeiHuang. Since the fix is the same as these other accessors, I'll give @ApolllonDev the choice whether to work on the other accessors as well or pass it on to you. 
That would be great!
pls update per comments
Hello @ApolllonDev! Thanks for updating this PR. We checked the lines you've touched for [PEP 8](https://www.python.org/dev/peps/pep-0008) issues, and found:



* In the file [`asv_bench/benchmarks/timestamp.py`](https://github.com/pandas-dev/pandas/blob/67eec73ed71c77ebbe385583c1a84050a06bff59/asv_bench/benchmarks/timestamp.py):

> [Line 51:1](https://github.com/pandas-dev/pandas/blob/67eec73ed71c77ebbe385583c1a84050a06bff59/asv_bench/benchmarks/timestamp.py#L51): [W293](https://duckduckgo.com/?q=pep8%20W293) blank line contains whitespace























##### Comment last updated at 2019-06-02 19:44:58 UTC