Docstring changes to pandas.Series.dt.to_pydatetime
State: closed

Checklist for the pandas documentation sprint (ignore this if you are doing
an unrelated PR):

- [x] PR title is "DOC: update the <your-function-or-method> docstring"
- [x] The validation script passes: `scripts/validate_docstrings.py <your-function-or-method>`
- [x] The PEP8 style check passes: `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] The html version looks good: `python doc/make.py --single <your-function-or-method>`
- [x] It has been proofread on language by another sprint participant

Please include the output of the validation script below between the "```" ticks:

```
scripts/validate_docstrings.py pandas.Series.dt.to_pydatetime

Errors found:
        No extended summary found

Extended Summary removed as per Reviewers suggestion.


Checklist for other PRs (remove this part if you are doing a PR for the pandas documentation sprint):

- [x] closes #xxxx
- [ ] tests added / passed
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry


Labels:
name: Docs
name: Datetime
description: Datetime data dtype

Comments:
Hello @priya-gitTest! Thanks for updating the PR.



Cheers ! There are no PEP8 issues in this Pull Request. :beers: 

##### Comment last updated on March 13, 2018 at 10:52 Hours UTC
fixed the PEP8 issues
@priya-gitTest I think you replied to all of Jeff's comments. Make sure to push your changes when you're ready :)
Have pushed the changes. Can you Review them @jreback 
@priya-gitTest Updated some of my comments reflecting this is in accessors.py (and not the DatetimeIndex version). The other comments still stand though
Done, Kindly review
lgtm. @jorisvandenbossche @TomAugspurger I am fine that the accessors look this way. possibly could add a pure index example as well.
FYI, this returns an ndarray, not a series or datetimeindex. Fixing up now.
Thanks @priya-gitTest are you able to pull my changes and make these last few recommendations?
Hi @TomAugspurger  ,  I will try to pull and fix changes suggested by @datapythonista
Pushed the fixes. Kindly check !!!
Sorry, seems like you pushed many commits unrelated to this PR. Can you take a look?
Hi datapythonista,

I had to reset my master. That might be the cause as l had some local changes another DocString changes :(

 I had done 
git reset --hard HEAD
git clean -f
git pull

Will see , if i can do something about it :(
I'd say that in general you can just get the new changes to your branch by:
```
git checkout <your-branch>
git fetch upstream
git merge upstream/master
```

It may be a bit tricky now. I'd do a manual copy of your docstring somewhere else, before playing too much with git. :)
Thanks Marc. Resolving GIT issues are indeed tricky. I did used those steps but i wanted to work on another function and it had an un-commited file changes , hence some errors ...
Found this one for future http://blog.dennisrobinson.name/push-only-one-commit-with-git/.
Not going to play around with this on this branch ;)
Removedd the references to DatetimeIndex. Sorry about messing that up intitially @priya-gitTest.
Ah one thing I just thought of, we should add a warning about nanosecond-precision data not being supported by python's datetime.datetime.

```python
In [13]: idx = pd.date_range('2017', periods=4, freq='ns')

In [14]: idx
Out[14]:
DatetimeIndex([          '2017-01-01 00:00:00',
               '2017-01-01 00:00:00.000000001',
               '2017-01-01 00:00:00.000000002',
               '2017-01-01 00:00:00.000000003'],
              dtype='datetime64[ns]', freq='N')

In [15]: idx.to_pydatetime()
Out[15]:
array([datetime.datetime(2017, 1, 1, 0, 0),
       datetime.datetime(2017, 1, 1, 0, 0),
       datetime.datetime(2017, 1, 1, 0, 0),
       datetime.datetime(2017, 1, 1, 0, 0)], dtype=object)
```

@priya-gitTest do you want to handle that? It should probably go in a `..warning` box right after the note about timezone info being retained, and as an example.
Hi @TomAugspurger , I would have loved to fix it but i have messed up my local GIT repository. I could only undo upto your good changes of 35ce553061adb2ca6c7f29549f8ba3682cbe4eb2 . Whenever i pull or push , i have merge conflicts and i don't want to push other people's changes via my PUSH. So, just let me know when i can close or delete my branch.

@priya-gitTest I think your branch looks all right now. May be I'm missing something, but I'd say that:
```
git checkout docstring_series_to_pydatetime
git pull
git fetch upstream
git merge upstream/master
```
shouldn't give you any conflict, and leave your changes with the latest version.

Otherwise, you can always do a new `git clone`, in a different directory, create a branch with the same name, change manually the docstring there, commit, and push to the remote branch (I think `git push -u -f origin docstring_series_to_pydatetime` should do the trick).
And there's always the nuclear option of `git reset --hard <branch>` so `git reset --hard origin/ docstring_series_to_pydatetime` in this case. But that throws away local changes.
Thanks all. I will give it a shot in a while and keep you
 posted :)
kindly review @jorisvandenbossche @TomAugspurger 
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/20198?src=pr&el=h1) Report
> Merging [#20198](https://codecov.io/gh/pandas-dev/pandas/pull/20198?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/31afaf858604ab85665b54b92f40cef19d69a28d?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `n/a`.

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

```diff
@@           Coverage Diff           @@
##           master   #20198   +/-   ##
=======================================
  Coverage   91.72%   91.72%           
=======================================
  Files         150      150           
  Lines       49165    49165           
=======================================
  Hits        45099    45099           
  Misses       4066     4066
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.11% <ø> (ø)` | :arrow_up: |
| #single | `41.86% <ø> (ø)` | :arrow_up: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/20198?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/indexes/accessors.py](https://codecov.io/gh/pandas-dev/pandas/pull/20198/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9hY2Nlc3NvcnMucHk=) | `90.19% <ø> (ø)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/20198?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/20198?src=pr&el=footer). Last update [31afaf8...932feff](https://codecov.io/gh/pandas-dev/pandas/pull/20198?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

And thanks for the PR! @priya-gitTest 
Thanks everyone here again :)