BrandonFors/pandas-github-issues huggingface dataset:
DOC/DEPR: pivot_annual
State: closed

- [x] closes #736
- [x] tests added / passed
- [x] passes `git diff upstream/master | flake8 --diff`
- [x] whatsnew entry

Updated cookbook attaching SO link of original issue.

BTW, `pivot_annual` has a similar functionality but it looks to be replaced by `pivot_table` and datetime property access. Because the function is not on top `pd` namespace, shouldn't deprecate it?


Labels:
name: Docs
name: Deprecate
description: Functionality to remove in pandas

Comments:
yes this lgtm. @jorisvandenbossche any objections?

## [Current coverage](https://codecov.io/gh/pydata/pandas/pull/13706?src=pr) is **84.54%**

> Merging [#13706](https://codecov.io/gh/pydata/pandas/pull/13706?src=pr) into [master](https://codecov.io/gh/pydata/pandas/branch/master?src=pr) will decrease coverage by **<.01%**

``` diff
@@             master     #13706   diff @@
==========================================
  Files           141        141          
  Lines         51185      51164    -21   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
- Hits          43275      43255    -20   
+ Misses         7910       7909     -1   
  Partials          0          0          
```

> Powered by [Codecov](https://codecov.io?src=pr). Last updated by [506520b...d097bab](https://codecov.io/gh/pydata/pandas/compare/506520bd35331aa82db50686c07d96594cac0c10...d097babf8253d3e91c468f7be6cb12a724481d16?src=pr)

No real objections from me, although the functions (looking at the length of the code) seems to do a lot more than the cookbook example? 
SO gives no results for a search for pivot_annual, a good sign :-)

Deprecate `isleapyear` as well?

I agree should deprecate isleapyear but add on as an accessor for Timestamp/DTI and .dt
which should be straightforward to do

@jreback There were still some unresolved comments I think (deprecating isleapyear as well)

@jorisvandenbossche ahh yes, I mean to make an issue about that.

I wii subbmit new PR (to deprecate `isleapyear` and adding the same proprty).

one minor pount is the property name. `Timestamp` has property like `.is_year_end`, numpy datetime.c has `is_leapyear` on the other hand. Which is prefereble, `is_leap_year` or `is_leapyear`?

no problem!

I think `is_leapyear` is fine

`leapyear` is really the common english word (I see though already getting inconsistent as we should really do `is_year_leap`)?
PERF: Improve Period hashing
State: closed

- [x] closes #12817
- [x] tests added / passed
- [x] passes `git diff upstream/master | flake8 --diff`
- [x] whatsnew entry

```
# asv
-   33.75ms     3.22ms      0.10  period.period_algorithm.time_period_series_drop_duplicates
```


Labels:
name: Performance
description: Memory or execution speed performance
name: Period
description: Period data type

Comments:
i think this needs a rebase

## [Current coverage](https://codecov.io/gh/pydata/pandas/pull/13705?src=pr) is **84.54%**

> Merging [#13705](https://codecov.io/gh/pydata/pandas/pull/13705?src=pr) into [master](https://codecov.io/gh/pydata/pandas/branch/master?src=pr) will not change coverage

``` diff
@@             master     #13705   diff @@
==========================================
  Files           141        141          
  Lines         51161      51161          
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
  Hits          43252      43252          
  Misses         7909       7909          
  Partials          0          0          
```

> Powered by [Codecov](https://codecov.io?src=pr). Last updated by [4c9ae94...e1fb7f4](https://codecov.io/gh/pydata/pandas/compare/4c9ae94f1ee4d867e2d92735d5755d43daef618d...e1fb7f426c7c7b9213c89c4e56356e1edbe45459?src=pr)

thanks!
MAINT: Removed some warnings in tests
State: closed

Per discussion with @jreback <a href="https://github.com/pydata/pandas/pull/13671#issuecomment-233508468">here</a>.


Labels:
name: Testing
description: pandas testing functions or related to the test suite
name: Categorical
description: Categorical Data Type

Comments:
## [Current coverage](https://codecov.io/gh/pydata/pandas/pull/13702?src=pr) is **84.52%**

> Merging [#13702](https://codecov.io/gh/pydata/pandas/pull/13702?src=pr) into [master](https://codecov.io/gh/pydata/pandas/branch/master?src=pr) will decrease coverage by **<.01%**

``` diff
@@             master     #13702   diff @@
==========================================
  Files           141        141          
  Lines         51145      51145          
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
- Hits          43233      43230     -3   
- Misses         7912       7915     +3   
  Partials          0          0          
```

> Powered by [Codecov](https://codecov.io?src=pr). Last updated by [8acfad3...e7292d3](https://codecov.io/gh/pydata/pandas/compare/8acfad343c88760a6d09fea221996dd50393fa8a...e7292d374c9d43f7be2dc636cb9aaefa88a58164?src=pr)

@jreback : it seems like `test_categorical.py` has A LOT of tests where they expect to use `np.nan` as a category.  Does it make sense to modify / remove them?

can't be very many as we have a warning for it
I only see a few

1) A Ctrl+F returns 30+ results (all of them caught with `tm.assert_produces_warnings(FutureWarning)`
of course).
2) So is that a yes or no?

there are warnings but should not be from that

pls show an example or 2

1) Constructor tests <a href="https://github.com/gfyoung/pandas/blob/feecb8b59d9417963d3e2945d9c38894bd3834b8/pandas/tests/test_categorical.py#L155">here</a> (just testing that duplicates get rejected)

2) Describing with `NaN` categories <a href="https://github.com/gfyoung/pandas/blob/feecb8b59d9417963d3e2945d9c38894bd3834b8/pandas/tests/test_categorical.py#L612">here</a>

3) Another constructor test <a href="https://github.com/gfyoung/pandas/blob/feecb8b59d9417963d3e2945d9c38894bd3834b8/pandas/tests/test_categorical.py#L1137">here</a>.

4) This entire test <a href="https://github.com/gfyoung/pandas/blob/feecb8b59d9417963d3e2945d9c38894bd3834b8/pandas/tests/test_categorical.py#L1147">here</a>.

5) Setter tests <a href="https://github.com/gfyoung/pandas/blob/feecb8b59d9417963d3e2945d9c38894bd3834b8/pandas/tests/test_categorical.py#L1429">here</a>.

Perhaps I'm conflating unnecessary tests with backwards compat tests since the code still has to work with this deprecated behaviour, not sure...

yeah these are all fine
when this behavior is removed in the future the tests can be changed

for now since we have enough catching of the warning
prob just fix the examples that were causing a warning (rather than catch them)

Okay, sounds good.  I'll fix the other one then.

@jreback : Removed the previous warnings, and Travis is still passing.  Ready to merge if there are no other concerns.

ty!
CLN: Removed the return_type param in StringMethods.split
State: closed

Continues where #10085 left off by removing the `return_type` parameter for good.


Labels:
name: Strings
description: String extension data type and string data
name: Deprecate
description: Functionality to remove in pandas

Comments:
## [Current coverage](https://codecov.io/gh/pydata/pandas/pull/13701?src=pr) is **84.52%**

> Merging [#13701](https://codecov.io/gh/pydata/pandas/pull/13701?src=pr) into [master](https://codecov.io/gh/pydata/pandas/branch/master?src=pr) will decrease coverage by **<.01%**

``` diff
@@             master     #13701   diff @@
==========================================
  Files           141        141          
  Lines         51145      51144     -1   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
- Hits          43233      43232     -1   
  Misses         7912       7912          
  Partials          0          0          
```

> Powered by [Codecov](https://codecov.io?src=pr). Last updated by [8acfad3...38531c2](https://codecov.io/gh/pydata/pandas/compare/8acfad343c88760a6d09fea221996dd50393fa8a...38531c20cd5f7711eb7a4e4afb7ae8e34bfe3ca7?src=pr)

@sinhrks : Made the requested doc change (hence the `[ci skip]`), so ready to merge if there are no other concerns.

@jreback , @sinhrks : Rebased to fix merge conflict, and Travis is still passing.  Ready to merge if there are no other concerns.

@jreback , @sinhrks : Any updates on this?

Thanks!
BUG: merge_asof not handling allow_exact_matches and tolerance on first entry
State: closed

closes #13695


Labels:
name: Bug
name: Reshaping
description: Concat, Merge/Join, Stack/Unstack, Explode

Comments:
@chrisaycock if you have more examples happy to add.

## [Current coverage](https://codecov.io/gh/pydata/pandas/pull/13698?src=pr) is **84.38%**

> Merging [#13698](https://codecov.io/gh/pydata/pandas/pull/13698?src=pr) into [master](https://codecov.io/gh/pydata/pandas/branch/master?src=pr) will not change coverage

``` diff
@@             master     #13698   diff @@
==========================================
  Files           142        142          
  Lines         51223      51223          
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
  Hits          43224      43224          
  Misses         7999       7999          
  Partials          0          0          
```

> Powered by [Codecov](https://codecov.io?src=pr). Last updated by [ada6bf3...c46dcfa](https://codecov.io/gh/pydata/pandas/compare/ada6bf350f7fd4daaf2b80188ca165fb9543a252...c46dcfadceb033167f864c3c8925aee39220cdc4?src=pr)
PERF: improve DTI string parse
State: closed

- [x] closes #11169, closes #11287
- [x] tests added / passed
- [x] passes `git diff upstream/master | flake8 --diff`
- [x] whatsnew entry

cleaned up `DatetimeIndex` constructor removing slower string-parsing path.
## Performance Improvement

related to #7599, internally use `to_datetime` always as it tries some fastpath.

```
inp = np.array(['2011-01-01 09:00' for i in range(10000)])

# on current master
%timeit pd.DatetimeIndex(inp)
1 loops, best of 3: 3.41 s per loop
%timeit pd.to_datetime(inp)
100 loops, best of 3: 4.77 ms per loop

# after the PR
%timeit pd.DatetimeIndex(inp)
#100 loops, best of 3: 4.23 ms per loop
%timeit pd.to_datetime(inp)
#100 loops, best of 3: 4.25 ms per loop
```
## Bug Fixes

The cleanup fixed these 2 kind of issues:
#### 1. #11169 and #11287 Invalid string parsing may raise `TypeError`

I met the same issue on travis and fixed with try-except clause (I can't reproduce it on my local Mac). 
#### 2. Index may incorrectly coerces mismatched tz

on current master, `DatetimeIndex` and normal `Index` behaves differently.

```
# OK
pd.DatetimeIndex([pd.Timestamp('2011-01-01', tz='US/Eastern')], tz='US/Pacific')
# TypeError: Already tz-aware, use tz_convert to convert.

# NG, it ignores mismatch and coerce to passed tz
pd.Index([pd.Timestamp('2011-01-01', tz='US/Eastern')], tz='US/Pacific')
DatetimeIndex(['2010-12-31 21:00:00-08:00'], dtype='datetime64[ns, US/Pacific]', freq=None)
```

after the PR both behave the same, showing understandable error.

```
pd.Index([pd.Timestamp('2011-01-01', tz='US/Eastern')], tz='US/Pacific')
# TypeError: data is already tz-aware US/Eastern, unable to set specified tz: US/Pacific

pd.DatetimeIndex([pd.Timestamp('2011-01-01', tz='US/Eastern')], tz='US/Pacific')
# TypeError: data is already tz-aware US/Eastern, unable to set specified tz: US/Pacific
```


Labels:
name: Datetime
description: Datetime data dtype
name: Performance
description: Memory or execution speed performance
name: Timezones
description: Timezone data dtype

Comments:
## [Current coverage](https://codecov.io/gh/pydata/pandas/pull/13692?src=pr) is **84.54%**

> Merging [#13692](https://codecov.io/gh/pydata/pandas/pull/13692?src=pr) into [master](https://codecov.io/gh/pydata/pandas/branch/master?src=pr) will decrease coverage by **<.01%**

``` diff
@@             master     #13692   diff @@
==========================================
  Files           141        141          
  Lines         51185      51159    -26   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
- Hits          43275      43250    -25   
+ Misses         7910       7909     -1   
  Partials          0          0          
```

> Powered by [Codecov](https://codecov.io?src=pr). Last updated by [506520b...8774772](https://codecov.io/gh/pydata/pandas/compare/506520bd35331aa82db50686c07d96594cac0c10...8774772d016578f154a8847ea3a86f151a576b2f?src=pr)

@sinhrks this cleans up lots of junk!

just a couple of clarifications.

lgtm. ready to go?

yes, it's ready:)
BUG: Add  type check for width parameter in str.pad method GH13598
State: closed

- [x] closes #13598 
- [x] tests added / passed
- [x] passes `git diff upstream/master | flake8 --diff`
- [x] whatsnew entry


Labels:
name: Error Reporting
description: Incorrect or improved errors from pandas
name: Strings
description: String extension data type and string data

Comments:
Thx! can u add tests all methods uses `str_pad`, i.g. `pad`, `center`, `ljust`, `rjust` and `zfill`.

I wrote all the tests, however it seemed extremely redundant doing so. I know that redundancy isn't necessarily a bad thing when testing, but is there a better way to implement them?

Thanks

## [Current coverage](https://codecov.io/gh/pydata/pandas/pull/13690?src=pr) is **84.38%**

> Merging [#13690](https://codecov.io/gh/pydata/pandas/pull/13690?src=pr) into [master](https://codecov.io/gh/pydata/pandas/branch/master?src=pr) will increase coverage by **<.01%**

``` diff
@@             master     #13690   diff @@
==========================================
  Files           142        142          
  Lines         51223      51226     +3   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits          43224      43227     +3   
  Misses         7999       7999          
  Partials          0          0          
```

> Powered by [Codecov](https://codecov.io?src=pr). Last updated by [ada6bf3...9669f3f](https://codecov.io/gh/pydata/pandas/compare/ada6bf350f7fd4daaf2b80188ca165fb9543a252...9669f3f139445a98d38d7feee1d12ab04fe0362d?src=pr)

thanks @wcwagner
BUG: Cast a key to NaT before get loc from Index
State: closed

- [x] closes #13603
- [x] tests added / passed
- [x] passes `git diff upstream/master | flake8 --diff`
- [x] whatsnew entry

pd.NaT, None, float('nan') and np.nan are
converted NaT in TestTimedeltas.
So we should convert keys if keys are these value.

Fix #13603


Labels:
name: Bug
name: Missing-data
description: np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate
name: Timedelta
description: Timedelta data type

Comments:
## [Current coverage](https://codecov.io/gh/pydata/pandas/pull/13687?src=pr) is **84.38%**

> Merging [#13687](https://codecov.io/gh/pydata/pandas/pull/13687?src=pr) into [master](https://codecov.io/gh/pydata/pandas/branch/master?src=pr) will increase coverage by **<.01%**

``` diff
@@             master     #13687   diff @@
==========================================
  Files           142        142          
  Lines         51223      51225     +2   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits          43224      43226     +2   
  Misses         7999       7999          
  Partials          0          0          
```

> Powered by [Codecov](https://codecov.io?src=pr). Last updated by [6b9cd15...0960395](https://codecov.io/gh/pydata/pandas/compare/6b9cd15f6a655b1ade2c571e32e142bf56dde769...096039564b688decf8ab6365dcda6f779a3ee7cc?src=pr)

I _think_ related issues should be fixed by changing `pd.Timedelta` to return `pd.NaT` for these nat-likes (also `_is_convertible_to_td` should include nat-likes). 

```
# OK
pd.Timestamp(np.nan)
# NaT
pd.Period(np.nan)
# NaT
pd.Timedelta(np.nan)
# NaT

# NG, Timedelta should return pd.NaT
pd.Timestamp(None)
# NaT
pd.Period(None)
# NaT
pd.Timedelta(None)
# ValueError: cannot construct a Timedelta without a value/unit or descriptive keywords (days,seconds....)
```

I will challenge `pd.Timedelta` issue on another PR :)

ok, pls add a whatsnew entry, otherwise lgtm.

Updated a whatsnew entry!

thanks!

😄
DOC: Fix a name of option
State: closed

- [ ] closes #xxxx
- [ ] tests added / passed
- [x] passes `git diff upstream/master | flake8 --diff`
- [ ] whatsnew entry


Labels:
name: Docs

Comments:
## [Current coverage](https://codecov.io/gh/pydata/pandas/pull/13686?src=pr) is **84.38%**

> Merging [#13686](https://codecov.io/gh/pydata/pandas/pull/13686?src=pr) into [master](https://codecov.io/gh/pydata/pandas/branch/master?src=pr) will not change coverage

``` diff
@@             master     #13686   diff @@
==========================================
  Files           142        142          
  Lines         51223      51223          
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
  Hits          43224      43224          
  Misses         7999       7999          
  Partials          0          0          
```

> Powered by [Codecov](https://codecov.io?src=pr). Last updated by [043879f...be9ec3f](https://codecov.io/gh/pydata/pandas/compare/043879fbb7de71605eed87991eb037c1917bace1...be9ec3fecf179129fc7400d276cf9eed23feeabe?src=pr)

@yui-knk Thanks!
DOC: slight change in .cum* function descriptions
State: closed

closes #13682

I changed the template function to use the _desc_ instead of the _name_ in generic.py.

SIDENOTE: I accidentally committed to a branch with another PR, so I rebased without it and created a new branch with this commit. 


Labels:
name: Docs

Comments:
## [Current coverage](https://codecov.io/gh/pydata/pandas/pull/13683?src=pr) is **84.38%**

> Merging [#13683](https://codecov.io/gh/pydata/pandas/pull/13683?src=pr) into [master](https://codecov.io/gh/pydata/pandas/branch/master?src=pr) will increase coverage by **<.01%**

``` diff
@@             master     #13683   diff @@
==========================================
  Files           142        142          
  Lines         51223      51223          
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits          43223      43224     +1   
+ Misses         8000       7999     -1   
  Partials          0          0          
```

> Powered by [Codecov](https://codecov.io?src=pr). Last updated by [d7c028d...ada4cda](https://codecov.io/gh/pydata/pandas/compare/d7c028d4965932160fa3b69f56c716b1454c42a5...ada4cda58ce8eac4c55608539c4540e86de8a9ce?src=pr)

@shawnheide Good catch, thanks a lot!
COMPAT: use mpl area legend if available
State: closed

- [x] closes #9161, closes #13544
- [x] tests added / passed
- [x] passes `git diff upstream/master | flake8 --diff`
- [x] whatsnew entry

Do not use area legend workaround if mpl >= 1.5.0 is available. Legends are now displayed properly if mpl >= 1.5.0.
#9161:

```
df = pd.DataFrame(np.random.rand(10, 3))
df.plot(kind='area', subplots=True, sharex=True, legend=True)
```

![index](https://cloud.githubusercontent.com/assets/1696302/16897682/4ee78324-4bf3-11e6-8113-65d68ec28b09.png)
#13544:

```
df = pd.DataFrame(np.random.rand(20, 5), columns=['A', 'B', 'C', 'D', 'E'])
df.plot(kind='area', linewidth=0.1).legend(loc="center left", bbox_to_anchor=(1.02, 0.5))
```

![index2](https://cloud.githubusercontent.com/assets/1696302/16897684/61eb4370-4bf3-11e6-9472-cec27297b7d1.png)


Labels:
name: Visualization
description: plotting
name: Compat
description: pandas objects compatability with Numpy or Python functions

Comments:
## [Current coverage](https://codecov.io/gh/pydata/pandas/pull/13680?src=pr) is 85.30% (diff: 72.72%)

> Merging [#13680](https://codecov.io/gh/pydata/pandas/pull/13680?src=pr) into [master](https://codecov.io/gh/pydata/pandas/branch/master?src=pr) will decrease coverage by **<.01%**

``` diff
@@             master     #13680   diff @@
==========================================
  Files           139        139          
  Lines         50143      50146     +3   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
  Hits          42776      42776          
- Misses         7367       7370     +3   
  Partials          0          0          
```

> Powered by [Codecov](https://codecov.io?src=pr). Last update [142c796...968aecc](https://codecov.io/gh/pydata/pandas/compare/142c7968a1918fd56b7ad40ea7c013a48b0c25fc...968aecc1dfaf3e67f9dce8db685cae98c984b42f?src=pr)

Looks good to me. @TomAugspurger Can you have a look?

Just the one question, but not really relevant to this PR. +1

Oh, might want a whatsnew entry.

@TomAugspurger status of this?
Add reference of DataFrame.rename_axis and Series.rename_axis to api.rst
State: closed

- [x] closes #13642
- [ ] tests added / passed
- [ ] passes `git diff upstream/master | flake8 --diff`
- [ ] whatsnew entry


Labels:
name: Docs

Comments:
## [Current coverage](https://codecov.io/gh/pydata/pandas/pull/13678?src=pr) is **84.38%**

> Merging [#13678](https://codecov.io/gh/pydata/pandas/pull/13678?src=pr) into [master](https://codecov.io/gh/pydata/pandas/branch/master?src=pr) will increase coverage by **<.01%**

``` diff
@@             master     #13678   diff @@
==========================================
  Files           142        142          
  Lines         51223      51223          
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits          43223      43224     +1   
+ Misses         8000       7999     -1   
  Partials          0          0          
```

> Powered by [Codecov](https://codecov.io?src=pr). Last updated by [d7c028d...0fda07f](https://codecov.io/gh/pydata/pandas/compare/d7c028d4965932160fa3b69f56c716b1454c42a5...0fda07f71678be8041542f46d93b194d570640ac?src=pr)

@sinhrks I added the commit for Series as requested and squashed the commits together. This is my first PR, so feel free to let me know if there's a better way to do this. 

Thanks. Congrats on your first PR to pandas 🎉 

The changes should show up [here](http://pandas-docs.github.io/pandas-docs-travis/) a bit after [this](https://travis-ci.org/pydata/pandas/builds/145343146) Travis run finishes.