BrandonFors/pandas-github-issues huggingface dataset:
BUG: GH13629 Binned groupby median function calculates median on empt…
State: closed

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


Labels:
name: Bug
name: Groupby
name: Categorical
description: Categorical Data Type

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

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

``` diff
@@             master     #14225   diff @@
==========================================
  Files           140        140          
  Lines         50559      50560     +1   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits          43099      43101     +2   
+ Misses         7460       7459     -1   
  Partials          0          0          
```

> Powered by [Codecov](https://codecov.io?src=pr). Last update [e8357a1...42affd5](https://codecov.io/gh/pydata/pandas/compare/e8357a15cd61ff698cbd3d57904133c586a8ed8b...42affd50b9dc728d5b8943cafe475327142ac5a7?src=pr)

lgtm, @jreback?

lgtm

merge away
add check for infinity in __call__ of EngFormatter
State: closed

EngFormatter throws an exception if passed 'inf' as below.

This patch checks for infinity and just returns 'inf' in that case.  The fix is analagous to the recent fix for NaN: 

https://github.com/pydata/pandas/commit/d0734ba4d0f4c228110dc3974943ce4ec2adeea4

``` python

import pandas
import pandas.core.format as fmt

ef = fmt.EngFormatter()
ef(pandas.np.inf)

...
```

---

OverflowError                             Traceback (most recent call last)
<ipython-input-17-c4aa659346ee> in <module>()
      3 
      4 ef = fmt.EngFormatter()
----> 5 ef(pandas.np.inf)

/usr/lib/python3/dist-packages/pandas/core/format.py in **call**(self, num)
   2485 
   2486         if dnum != 0:
-> 2487             pow10 = decimal.Decimal(int(math.floor(dnum.log10() / 3) \* 3))
   2488         else:
   2489             pow10 = decimal.Decimal(0)

OverflowError: cannot convert Infinity to integer


Labels:
name: Bug
name: Output-Formatting
description: __repr__ of pandas objects, to_string

Comments:
tests pls

## [Current coverage](https://codecov.io/gh/pydata/pandas/pull/14214?src=pr) is 85.23% (diff: 50.00%)

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

``` diff
@@             master     #14214   diff @@
==========================================
  Files           140        140          
  Lines         50566      50568     +2   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits          43102      43104     +2   
  Misses         7464       7464          
  Partials          0          0          
```

> Powered by [Codecov](https://codecov.io?src=pr). Last update [f363236...83f4091](https://codecov.io/gh/pydata/pandas/compare/f3632368ed703f3f0586b4f79e26f3eeb4e2a2c2...83f409122c1b1b8da00e2261517db1227810e349?src=pr)

thanks!

A pleasure.  Pandas is magic.

On 13 Sep 2016 19:00, "Jeff Reback" notifications@github.com wrote:

> thanks!
> 
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> https://github.com/pydata/pandas/pull/14214#issuecomment-246839271, or mute
> the thread
> https://github.com/notifications/unsubscribe-auth/AAPW25I6CyKwwpIw8sAuzo3JBXKDx9z-ks5qpxzzgaJpZM4J8CRc
> .
BUG: loffset not applied when using resample with agg() (GH13218)
State: closed

- [x] closes #13218  and #15002 (continuation of closed PR https://github.com/pydata/pandas/pull/13861)
- [x] tests added / passed
- [x] passes `git diff upstream/master | flake8 --diff`
- [x] whatsnew entry

_apply_loffset is called in resampler's downsample and groupby_and_agg methods, defined [here](https://github.com/pydata/pandas/blob/master/pandas/tseries/resample.py#L535) and [here](https://github.com/pydata/pandas/blob/master/pandas/tseries/resample.py#L545)

When a `str` is passed into `aggregate`, the above methods are called [here](https://github.com/pydata/pandas/blob/master/pandas/core/base.py#L431), and consequently the loffset is applied. 

**However**, if anything other than a `str` is passed into `aggregate`, then a different path will be taken and **the loffset must be applied**. So a simple check in `aggregate` will apply the loffset correctly.

note: my last PR was closed, and I can't reopen it by a force push, hence the new one


Labels:
name: Bug
name: Resample
description: resample method

Comments:
## [Current coverage](https://codecov.io/gh/pandas-dev/pandas/pull/14213?src=pr) is 84.78% (diff: 100%)
> Merging [#14213](https://codecov.io/gh/pandas-dev/pandas/pull/14213?src=pr) into [master](https://codecov.io/gh/pandas-dev/pandas/branch/master?src=pr) will increase coverage by **<.01%**

```diff
@@             master     #14213   diff @@
==========================================
  Files           145        145          
  Lines         51090      51094     +4   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits          43315      43321     +6   
+ Misses         7775       7773     -2   
  Partials          0          0          
```

> Powered by [Codecov](https://codecov.io?src=pr). Last update [e27b296...8619e9e](https://codecov.io/gh/pandas-dev/pandas/compare/e27b29697f0dcf9359f01a19edb2f20c6d728b6c...8619e9efa1ddd32397bab44cdea959b8f9ddc221?src=pr)
@wcwagner if you want to update to 0.19.2 and rebase, we can take another look.
can you move release note to 0.20.0
Sorry for the delay, I will update everything tomorrow.
pls add example referenced in #15002 as well (your changes should cover it)
@jreback do you want me to add the example in #15002 into the unittests? I suppose it would be a good idea to do so, seeing as it tests the `how` parameter (even though it's deprecated).
yep
Seems like resample's loffset tests were removed from `TestPeriodIndex` and `TestTimedeltaIndex`. Should I remove my tests from those two as well?
thanks @wcwagner 

I reworked this a bit to make it cleaner in https://github.com/pandas-dev/pandas/commit/366241386282272328333256b6e267a68f8133a4

love for you to tackle some more issues!
DOC: fix incorrect example in unstack docstring (GH14206)
State: closed

- [x] closes #14206 

The following PR closes #14206 and corrects the Docs as suggested in the issue thread.
@jorisvandenbossche Kindly review.


Labels:
name: Docs

Comments:
I don't think you actually changed the output? (apart from the floating notation, which is OK). It is the output of `df.unstack()` that was wrong (the 2 and 3 are swapped), and which should be corrected.

## [Current coverage](https://codecov.io/gh/pydata/pandas/pull/14211?src=pr) is 85.24% (diff: 100%)

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

``` diff
@@             master     #14211   diff @@
==========================================
  Files           140        140          
  Lines         50563      50566     +3   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
  Hits          43103      43103          
- Misses         7460       7463     +3   
  Partials          0          0          
```

> Powered by [Codecov](https://codecov.io?src=pr). Last update [461e0e9...99c2f0b](https://codecov.io/gh/pydata/pandas/compare/461e0e9fba67b1f5cbe6ac5bd1db0272042777ee...99c2f0b6adf79571d235a1db48cb57b3884178d8?src=pr)

@jorisvandenbossche : Oops, my bad. I corrected the mistake now.

@sudk1896 Thanks for the fix! 
(small note: you had a small trailing whitespace error which was captured by our linter (I corrected it), but I would recommend setting your editor to automatically remove trailing whitespace)

@jorisvandenbossche: Will do from next time. Thanks.
ENH: Add divmod to series.
State: closed

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

edit: in the issue it said this is uncommon; however, I recently ran into an issue where I was doing arithmetic with fiscal quarters and using divmod seemed more natural.


Labels:
name: API Design
name: Numeric Operations
description: Arithmetic, Comparison, and Logical operations

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

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

``` diff
@@             master     #14208   diff @@
==========================================
  Files           140        140          
  Lines         50559      50567     +8   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits          43099      43107     +8   
  Misses         7460       7460          
  Partials          0          0          
```

> Powered by [Codecov](https://codecov.io?src=pr). Last update [5e2f9da...08b3939](https://codecov.io/gh/pydata/pandas/compare/5e2f9da6e8e713bd89cfe8760e63583ea7d29879...08b39390a0984748dcc08bfd83c3f45b7b43f554?src=pr)

I moved this into `add_special_arithmetic_methods`

I added `divmod` to  indices and made it less special for series. I don't see a simple way to get `divmod` on dataframe right now though.

ping

The clang build seemed to hang here, can we rerun it?

Thank you for rerunning, looks to be passing now

ping

thanks @llllllllll 

Thank you!
DOC: add source links to api docs
State: closed

- [x] closes #14178
- [x] tests not needed
- [x] passes `git diff upstream/master | flake8 --diff`
- [x] whatsnew not needed

cc @jorisvandenbossche  - like you mentioned, this doesn't work for everything (properties, accessors, some generated methods)


Labels:
name: Docs

Comments:
Here's an example of how it renders

![image](https://cloud.githubusercontent.com/assets/1924092/18411337/0aa5c680-773b-11e6-8edf-6d77548ce5bb.png)

looks nice.

@jorisvandenbossche 

## [Current coverage](https://codecov.io/gh/pydata/pandas/pull/14200?src=pr) is 85.24% (diff: 100%)

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

``` diff
@@             master     #14200   diff @@
==========================================
  Files           140        140          
  Lines         50563      50563          
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits          43101      43103     +2   
+ Misses         7462       7460     -2   
  Partials          0          0          
```

> Powered by [Codecov](https://codecov.io?src=pr). Last update [6c73e76...67a8161](https://codecov.io/gh/pydata/pandas/compare/6c73e765a5f1191c954c7789791818d2685c3c2c...67a81612647b4819ae0ac42d9b4353047ecc2726?src=pr)

@chris-b1 Thanks a lot! Then it at least works for those where it is possible
BUG: union_categorical with Series and cat idx
State: closed

- [x] closes #14173
- [ ] tests added / passed
- [x] passes `git diff upstream/master | flake8 --diff`
- [x] whatsnew entry (not needed)


Labels:
name: Bug
name: Categorical
description: Categorical Data Type

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

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

``` diff
@@             master     #14199   diff @@
==========================================
  Files           140        140          
  Lines         50556      50563     +7   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits          43095      43102     +7   
  Misses         7461       7461          
  Partials          0          0          
```

> Powered by [Codecov](https://codecov.io?src=pr). Last update [289cd6d...b04ea4d](https://codecov.io/gh/pydata/pandas/compare/289cd6d0df66b812921ff4c5cbade937b875406d...b04ea4d162d98a6ded508abc7a1861ff64057e91?src=pr)

thanks!
Fix: F999 dictionary key '2000q4' repeated with different values
State: closed

Removal of duplicate line to fix lint error

```
pandas/tseries/tests/test_tslib.py:685:18: F999 dictionary key '2000q4' repeated with different values
pandas/tseries/tests/test_tslib.py:690:18: F999 dictionary key '2000q4' repeated with different values
```


Labels:

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

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

``` diff
@@             master     #14198   diff @@
==========================================
  Files           140        140          
  Lines         50556      50556          
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
  Hits          43095      43095          
  Misses         7461       7461          
  Partials          0          0          
```

> Powered by [Codecov](https://codecov.io?src=pr). Last update [289cd6d...82459ba](https://codecov.io/gh/pydata/pandas/compare/289cd6d0df66b812921ff4c5cbade937b875406d...82459ba45a37dedbbe47b93c714a698476f01628?src=pr)

this is not a duplicate (it's lowercase)
otherwise the linter would have picked this up before

@jreback  Have a look: https://github.com/pydata/pandas/blob/master/pandas/tseries/tests/test_tslib.py

line 685 vs line 690:
'2000q4': datetime.datetime(2000, 10, 1),
'2000q4': datetime.datetime(2000, 10, 1),

exactly the same. Line 681 is a different case: 

'2000Q4': datetime.datetime(2000, 10, 1),

Lint must have got more stick with repeated keys.

hmm now it's failing 

https://travis-ci.org/pydata/pandas/jobs/158971225
Fix minor spacing issue
State: closed

Continuation of #13350
- [x] closes #13032 
- [ ] tests added / passed
- [x] passes `pep8radius master --diff`
- [x] whatsnew entry - not necessary

See https://github.com/pydata/pandas/pull/13350 for more details, mucked up my pull request. Tests will need a lot of work.


Labels:
name: Bug
name: Output-Formatting
description: __repr__ of pandas objects, to_string

Comments:
@jreback Should be up to date now. Tests still a mess.

@barrymoo Do you have time to update this?

I don't have enough time to fix the tests. I originally closed the pull request but I was asked to revive it.

OK, thanks for letting us know. I will then close this PR, but point on the issue to this PR as a start if someone else is able to take it on further.
BUG: Categorical constructor not idempotent with ext dtype
State: closed

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


Labels:
name: Dtype Conversions
description: Unexpected or buggy dtype conversions
name: Categorical
description: Categorical Data Type

Comments:
small comment but otherwise lgtm

## [Current coverage](https://codecov.io/gh/pydata/pandas/pull/14191?src=pr) is 85.24% (diff: 100%)

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

``` diff
@@             master     #14191   diff @@
==========================================
  Files           140        140          
  Lines         50555      50555          
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
- Hits          43095      43094     -1   
- Misses         7460       7461     +1   
  Partials          0          0          
```

> Powered by [Codecov](https://codecov.io?src=pr). Last update [8af6264...4cad147](https://codecov.io/gh/pydata/pandas/compare/8af626474f6f314527a9ad3f15403aa2dd8c402d...4cad147d42826ca5c8c665a96a97ccd90d226726?src=pr)

thanks!
BUG: fix str.contains for series containing only nan values
State: closed

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


Labels:
name: Bug
name: Strings
description: String extension data type and string data

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

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

``` diff
@@             master     #14182   diff @@
==========================================
  Files           140        140          
  Lines         50549      50550     +1   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits          43090      43091     +1   
  Misses         7459       7459          
  Partials          0          0          
```

> Powered by [Codecov](https://codecov.io?src=pr). Last update [d8cd33b...c7e9721](https://codecov.io/gh/pydata/pandas/compare/d8cd33b148daba78f1450c19c69cfe4896cfb98c...c7e972105b605be7c1f6928cc520cdc059ea081e?src=pr)

thanks! nicely done
DOC: clean-up 0.19.0 whatsnew file
State: closed

WIP (it's actually not critical for rc, as we do link to the dev docs (which are updated after rc release) anyway)


Labels:
name: Docs

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

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

``` diff
@@             master     #14176   diff @@
==========================================
  Files           140        139     -1   
  Lines         50549      50496    -53   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
- Hits          43091      43050    -41   
+ Misses         7458       7446    -12   
  Partials          0          0          
```

> Powered by [Codecov](https://codecov.io?src=pr). Last update [9b7efd6...5c3ad38](https://codecov.io/gh/pydata/pandas/compare/9b7efd69b2e88f5019d480ea4d5719bfaa7fa26b...5c3ad383b150292096b8b94c092e74029a9c31b1?src=pr)

@jreback Do you think of other things to include in the highlights?

Going to merge this now, we can do further clean-up later
DOC: cleanup build warnings
State: closed


Labels:
name: Docs

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

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

``` diff
@@             master     #14172   diff @@
==========================================
  Files           139        139          
  Lines         50496      50496          
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
  Hits          43049      43049          
  Misses         7447       7447          
  Partials          0          0          
```

> Powered by [Codecov](https://codecov.io?src=pr). Last update [8023029...9a0f983](https://codecov.io/gh/pydata/pandas/compare/80230292e19e377f5b11409e112500b6a180e18a...9a0f983beee6ba964ca32c6f537b66e93d44cbb7?src=pr)

minor comments, lgtm.
API/DEPR: Remove +/- as setops for DatetimeIndex/PeriodIndex (GH9630)
State: closed

xref #13777, deprecations put in place in #9630


Labels:
name: API Design
name: Clean

Comments:
Some todo's:
- still have to further clean-up the tests a bit (due to the previous API the tests for set ops and numeric ops are a bit mixed)
- need to add some more test cases for DTI - DTI (eg with NaNs)
- for subtraction of two `PeriodIndex` objects, this is currently raising a TypeError, but I think we could actually allow it? Although that maybe depends on what is decided in https://github.com/pydata/pandas/issues/13077

I think these should be the last remaining set ops as numeric ops that are now removed with this PR.

we need to wait for #13077 on `Period-Period` (so can discuss over there). Let's limit scope to the more useful DTI-DTI

## [Current coverage](https://codecov.io/gh/pydata/pandas/pull/14164?src=pr) is 85.25% (diff: 96.55%)

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

``` diff
@@             master     #14164   diff @@
==========================================
  Files           139        139          
  Lines         50496      50512    +16   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits          43049      43064    +15   
- Misses         7447       7448     +1   
  Partials          0          0          
```

> Powered by [Codecov](https://codecov.io?src=pr). Last update [8023029...21c6cec](https://codecov.io/gh/pydata/pandas/compare/80230292e19e377f5b11409e112500b6a180e18a...21c6cec62ae2ad1b3aa8356962365fdf0383c5d2?src=pr)

lgtm.