DOC:update the DatetimeIndex.tz_convert(tz)
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>`
- [ ] 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>`
- [ ] It has been proofread on language by another sprint participant

Please include the output of the validation script below between the "```" ticks:

```
(pandas_dev) root@kalih:~/pythonpanda/pandas# python scripts/validate_docstrings.py pandas.DatetimeIndex.tz_convert

################################################################################
################# Docstring (pandas.DatetimeIndex.tz_convert)  #################
################################################################################

A Method to Convert tz-aware DatetimeIndex from one time zone to another.

When using DatetimeIndex providing with timezone
this method converts tz-aware DatetimeIndex using
pytz/dateutil.

Parameters
----------
tz : string, pytz.timezone, dateutil.tz.tzfile or None
    Time zone for time. Corresponding timestamps would be converted to
    time zone of the TimeSeries.
    None will remove timezone holding UTC time.

Returns
-------
normalized : DatetimeIndex

Raises
-------
TypeError
    If DatetimeIndex is tz-naive.

See Also
--------
tz_localize : Localize tz-naive DatetimeIndex to given time zone (using pytz/dateutil),
    or remove timezone from tz-aware DatetimeIndex.

Examples
--------
>>> datetime=pd.Series(pd.date_range('20180301',periods=3))
>>> datetime
0   2018-03-01
1   2018-03-02
2   2018-03-03
dtype: datetime64[ns]

>>> datetime.dt.tz_localize('UTC').dt.tz_convert('US/Eastern')
0   2018-02-28 19:00:00-05:00
1   2018-03-01 19:00:00-05:00
2   2018-03-02 19:00:00-05:00
dtype: datetime64[ns, US/Eastern]

################################################################################
################################## Validation ##################################
################################################################################

Docstring for "pandas.DatetimeIndex.tz_convert" correct. :)


```

If the validation script still gives errors, but you think there is a good reason
to deviate in this case (and there are certainly such cases), please state this
explicitly.



Labels:

Comments:
Hello @hammadmashkoor! Thanks for updating the PR.

 - In the file [`pandas/core/indexes/datetimes.py`](https://github.com/pandas-dev/pandas/blob/cae4c92105c2b1768406627197b7bc3ea5d5ca99/pandas/core/indexes/datetimes.py), following are the PEP8 issues :

> [Line 1907:1](https://github.com/pandas-dev/pandas/blob/cae4c92105c2b1768406627197b7bc3ea5d5ca99/pandas/core/indexes/datetimes.py#L1907): [E101](https://duckduckgo.com/?q=pep8%20E101) indentation contains mixed spaces and tabs
> [Line 1907:1](https://github.com/pandas-dev/pandas/blob/cae4c92105c2b1768406627197b7bc3ea5d5ca99/pandas/core/indexes/datetimes.py#L1907): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 1907:58](https://github.com/pandas-dev/pandas/blob/cae4c92105c2b1768406627197b7bc3ea5d5ca99/pandas/core/indexes/datetimes.py#L1907): [W291](https://duckduckgo.com/?q=pep8%20W291) trailing whitespace
> [Line 1908:1](https://github.com/pandas-dev/pandas/blob/cae4c92105c2b1768406627197b7bc3ea5d5ca99/pandas/core/indexes/datetimes.py#L1908): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 1910:1](https://github.com/pandas-dev/pandas/blob/cae4c92105c2b1768406627197b7bc3ea5d5ca99/pandas/core/indexes/datetimes.py#L1910): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 1911:1](https://github.com/pandas-dev/pandas/blob/cae4c92105c2b1768406627197b7bc3ea5d5ca99/pandas/core/indexes/datetimes.py#L1911): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 1912:1](https://github.com/pandas-dev/pandas/blob/cae4c92105c2b1768406627197b7bc3ea5d5ca99/pandas/core/indexes/datetimes.py#L1912): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 1924:1](https://github.com/pandas-dev/pandas/blob/cae4c92105c2b1768406627197b7bc3ea5d5ca99/pandas/core/indexes/datetimes.py#L1924): [W293](https://duckduckgo.com/?q=pep8%20W293) blank line contains whitespace
> [Line 1925:1](https://github.com/pandas-dev/pandas/blob/cae4c92105c2b1768406627197b7bc3ea5d5ca99/pandas/core/indexes/datetimes.py#L1925): [E101](https://duckduckgo.com/?q=pep8%20E101) indentation contains mixed spaces and tabs
> [Line 1925:1](https://github.com/pandas-dev/pandas/blob/cae4c92105c2b1768406627197b7bc3ea5d5ca99/pandas/core/indexes/datetimes.py#L1925): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 1926:1](https://github.com/pandas-dev/pandas/blob/cae4c92105c2b1768406627197b7bc3ea5d5ca99/pandas/core/indexes/datetimes.py#L1926): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 1927:1](https://github.com/pandas-dev/pandas/blob/cae4c92105c2b1768406627197b7bc3ea5d5ca99/pandas/core/indexes/datetimes.py#L1927): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 1928:1](https://github.com/pandas-dev/pandas/blob/cae4c92105c2b1768406627197b7bc3ea5d5ca99/pandas/core/indexes/datetimes.py#L1928): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 1930:1](https://github.com/pandas-dev/pandas/blob/cae4c92105c2b1768406627197b7bc3ea5d5ca99/pandas/core/indexes/datetimes.py#L1930): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 1931:1](https://github.com/pandas-dev/pandas/blob/cae4c92105c2b1768406627197b7bc3ea5d5ca99/pandas/core/indexes/datetimes.py#L1931): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 1932:1](https://github.com/pandas-dev/pandas/blob/cae4c92105c2b1768406627197b7bc3ea5d5ca99/pandas/core/indexes/datetimes.py#L1932): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 1933:1](https://github.com/pandas-dev/pandas/blob/cae4c92105c2b1768406627197b7bc3ea5d5ca99/pandas/core/indexes/datetimes.py#L1933): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 1935:1](https://github.com/pandas-dev/pandas/blob/cae4c92105c2b1768406627197b7bc3ea5d5ca99/pandas/core/indexes/datetimes.py#L1935): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 1936:1](https://github.com/pandas-dev/pandas/blob/cae4c92105c2b1768406627197b7bc3ea5d5ca99/pandas/core/indexes/datetimes.py#L1936): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 1937:1](https://github.com/pandas-dev/pandas/blob/cae4c92105c2b1768406627197b7bc3ea5d5ca99/pandas/core/indexes/datetimes.py#L1937): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 1938:1](https://github.com/pandas-dev/pandas/blob/cae4c92105c2b1768406627197b7bc3ea5d5ca99/pandas/core/indexes/datetimes.py#L1938): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 1939:1](https://github.com/pandas-dev/pandas/blob/cae4c92105c2b1768406627197b7bc3ea5d5ca99/pandas/core/indexes/datetimes.py#L1939): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 1940:1](https://github.com/pandas-dev/pandas/blob/cae4c92105c2b1768406627197b7bc3ea5d5ca99/pandas/core/indexes/datetimes.py#L1940): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 1941:1](https://github.com/pandas-dev/pandas/blob/cae4c92105c2b1768406627197b7bc3ea5d5ca99/pandas/core/indexes/datetimes.py#L1941): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 1942:1](https://github.com/pandas-dev/pandas/blob/cae4c92105c2b1768406627197b7bc3ea5d5ca99/pandas/core/indexes/datetimes.py#L1942): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 1944:1](https://github.com/pandas-dev/pandas/blob/cae4c92105c2b1768406627197b7bc3ea5d5ca99/pandas/core/indexes/datetimes.py#L1944): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 1945:1](https://github.com/pandas-dev/pandas/blob/cae4c92105c2b1768406627197b7bc3ea5d5ca99/pandas/core/indexes/datetimes.py#L1945): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 1946:1](https://github.com/pandas-dev/pandas/blob/cae4c92105c2b1768406627197b7bc3ea5d5ca99/pandas/core/indexes/datetimes.py#L1946): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 1947:1](https://github.com/pandas-dev/pandas/blob/cae4c92105c2b1768406627197b7bc3ea5d5ca99/pandas/core/indexes/datetimes.py#L1947): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 1948:1](https://github.com/pandas-dev/pandas/blob/cae4c92105c2b1768406627197b7bc3ea5d5ca99/pandas/core/indexes/datetimes.py#L1948): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs



##### Comment last updated on March 10, 2018 at 03:55 Hours UTC