BrandonFors/pandas-github-issues huggingface dataset:
BUG: raise KeyError if MultiIndex.get_loc_level is asked unused label
State: closed

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


Labels:
name: Bug
name: MultiIndex

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

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

```diff
@@            Coverage Diff             @@
##           master   #22230      +/-   ##
==========================================
+ Coverage   92.07%   92.07%   +<.01%     
==========================================
  Files         169      169              
  Lines       50683    50684       +1     
==========================================
+ Hits        46666    46668       +2     
+ Misses       4017     4016       -1
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.48% <100%> (ø)` | :arrow_up: |
| #single | `42.34% <10%> (-0.01%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/22230?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/indexes/multi.py](https://codecov.io/gh/pandas-dev/pandas/pull/22230/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9tdWx0aS5weQ==) | `95.33% <100%> (+0.08%)` | :arrow_up: |

------

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

can you also add the original OP test somewhere.
thanks @toobaz
WIP - Bool Extension Array
State: closed

This is nowhere near complete as I have a ton of broken tests that need to be resolved, but theoretically progress towards #21778 as I get my feet wet with EAs.

My thought here was to leverage the masking operations used by the Integer EAs to implement an easy Boolean EA on top of that. I've essentially copied over all of the integer tests as well, though someone may have thoughts on a better way to structure all of this.

Any and all direction greatly appreciated

Labels:
name: Enhancement
name: ExtensionArray
description: Extending pandas with custom dtypes or arrays.

Comments:
Is the idea to make this a bit-per-entry?  If not, I'm not clear on what the benefit of this is.
No this would be using int8 underneath - I don't think a bit-per-entry is possible since that's not an addressable unit. 

Benefit would be to give users an easy way to cast to and store boolean data with the same masking technique that we are using for integers to denote missing data, albeit the actual implementation underneath uses int8. I figure that would be easier than completely reimplementing this with a dedicated bool subtype, though I'm also looking for feedback on that front
haven’t looked at the impl 

but the clear win for this is efficient boolean arrays with missing values

right now you get nice boolean arrays but as soon as you have a NaN you coerce to object (or worse to float)
> Benefit would be to give users an easy way to cast to and store boolean data with the same masking technique that we are using for integers to denote missing data

BoolNA makes sense to me, thanks for clarifying.

> No this would be using int8 underneath - I don't think a bit-per-entry is possible since that's not an addressable unit.

Yah this would takes some behind-the-scenes trickery.  Something like a length-N bool array being backed by a len-N/8 int8 array.
i made an issue about using bitarray as an impl detail for integer NA; would obviously be useful here as well (so this would then be really cheap from a memory perspective)
agree this is a nice idea and we should do it but closing as stale
If this ends up being possible, you may want to also provide it as an answer to [this StackOverflow question](https://stackoverflow.com/q/34520267/5085211).
Fix test_info_repr #21746
State: closed

Fixes test that fails locally in py27 when run in a terminal window wider than 80 characters.

- [x] closes #21746
- [x] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`


Labels:
name: Testing
description: pandas testing functions or related to the test suite
name: Output-Formatting
description: __repr__ of pandas objects, to_string

Comments:
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/22223?src=pr&el=h1) Report
> Merging [#22223](https://codecov.io/gh/pandas-dev/pandas/pull/22223?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/2156431c3a673fbfb720983474d3cb4edc92c332?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/22223/graphs/tree.svg?src=pr&token=eZ4WkYLtcO&height=150&width=650)](https://codecov.io/gh/pandas-dev/pandas/pull/22223?src=pr&el=tree)

```diff
@@           Coverage Diff           @@
##           master   #22223   +/-   ##
=======================================
  Coverage   92.06%   92.06%           
=======================================
  Files         169      169           
  Lines       50694    50694           
=======================================
  Hits        46671    46671           
  Misses       4023     4023
```

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


------

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

thanks!
CLN: Old timezone issues
State: closed

- [x] closes #21846
- [x] closes #21737
- [x] closes #20724
- [x] closes #18785
- [x] closes #18308 
- [x] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry


Labels:
name: Timezones
description: Timezone data dtype
name: Clean

Comments:
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/22201?src=pr&el=h1) Report
> Merging [#22201](https://codecov.io/gh/pandas-dev/pandas/pull/22201?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/776fed3ab63d74ddef6e5af1a702b10c2a30bbb6?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/22201/graphs/tree.svg?width=650&height=150&src=pr&token=eZ4WkYLtcO)](https://codecov.io/gh/pandas-dev/pandas/pull/22201?src=pr&el=tree)

```diff
@@           Coverage Diff           @@
##           master   #22201   +/-   ##
=======================================
  Coverage   92.06%   92.06%           
=======================================
  Files         169      169           
  Lines       50694    50694           
=======================================
  Hits        46671    46671           
  Misses       4023     4023
```

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


------

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

thanks @mroeschke nice cleaning these old issues!
BUG: DataFrame.asof() : Timezone Awareness / Naivety comparison TypeError
State: closed

- [X] closes #21194 
- [X] tests added / passed
- [X] whatsnew entry


Labels:
name: Datetime
description: Datetime data dtype
name: Indexing
description: Related to indexing on series/frames, not to indexes themselves
name: Dtype Conversions
description: Unexpected or buggy dtype conversions

Comments:
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/22198?src=pr&el=h1) Report
> :exclamation: No coverage uploaded for pull request base (`master@0850fbd`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference#section-missing-base-commit).
> The diff coverage is `100%`.

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

```diff
@@            Coverage Diff            @@
##             master   #22198   +/-   ##
=========================================
  Coverage          ?   92.06%           
=========================================
  Files             ?      169           
  Lines             ?    50694           
  Branches          ?        0           
=========================================
  Hits              ?    46671           
  Misses            ?     4023           
  Partials          ?        0
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.47% <100%> (?)` | |
| #single | `42.32% <0%> (?)` | |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/22198?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/indexes/base.py](https://codecov.io/gh/pandas-dev/pandas/pull/22198/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9iYXNlLnB5) | `96.37% <100%> (ø)` | |

------

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

@jreback @mroeschke Can you have a look?  This looks ready to merge.
thanks @msmarchena 
Thanks to all of you. 
and sorry for the mess, it was my first PR ;-)
Finish moving period_helper to cython
State: closed

- [x] closes #19465

There is probably some cleanup that can be done now that period logic is self-contained.

No evident perf impact.
```
asv continuous -E virtualenv -f 1.1 master HEAD -b period
[...]
       before           after         ratio
     [776fed3a]       [7cc0d9e8]
+        1.14±0μs      1.28±0.01μs     1.13  period.PeriodProperties.time_property('M', 'qyear')
-        579±30ms          509±4ms     0.88  groupby.Datelike.time_sum('period_range')
```

(will post results from a couple more runs as they become available)
<b> update<b/> two more runs show zero change, not even noise.

<b>update</b> Oh, also did some unrelated modernizing of string formatting in timedeltas.

Labels:
name: Period
description: Period data type
name: Clean

Comments:
https://travis-ci.org/pandas-dev/pandas/jobs/412170226#L3465

Looks like you have some linting failures.
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/22196?src=pr&el=h1) Report
> Merging [#22196](https://codecov.io/gh/pandas-dev/pandas/pull/22196?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/776fed3ab63d74ddef6e5af1a702b10c2a30bbb6?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/22196/graphs/tree.svg?width=650&token=eZ4WkYLtcO&height=150&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/22196?src=pr&el=tree)

```diff
@@           Coverage Diff           @@
##           master   #22196   +/-   ##
=======================================
  Coverage   92.06%   92.06%           
=======================================
  Files         169      169           
  Lines       50694    50694           
=======================================
  Hits        46671    46671           
  Misses       4023     4023
```

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


------

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

https://travis-ci.org/pandas-dev/pandas/jobs/412207881#L3475

Looks like you (still) have some linting failures. 🙁 
https://travis-ci.org/pandas-dev/pandas/jobs/412219771#L3474

Getting there, but not quite.  Are you able to check locally via [cpplint](https://github.com/pandas-dev/pandas/blob/2625759abeb78655558067d55a23c293628c3165/doc/source/contributing.rst#c-cpplint)?
> asv continuous -E virtualenv -f 1.1 master HEAD -b period

can you create an issue to add more period benchmarks

> can you create an issue to add more period benchmarks

Done
thanks!
Inconsistent behaviour when apply() used on categorical with NaN values
State: closed

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


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

Comments:
can you merge master and update
@manuhortet do you still want to take this on? @jreback if we don't hear back I will take this
@manuhortet or @alimcmaster1 if interested pls merge master
merge master and update
closing as stale if you want to continue working, please ping.
DOC: Update the Series.str.len docstring
State: closed

[X] PR title is "DOC: update the docstring"
[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


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

Comments:
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/22187?src=pr&el=h1) Report
> Merging [#22187](https://codecov.io/gh/pandas-dev/pandas/pull/22187?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/35dd15ba150175e8522e2d443ee4118b0d5c57ce?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `100%`.

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

```diff
@@           Coverage Diff           @@
##           master   #22187   +/-   ##
=======================================
  Coverage   92.06%   92.06%           
=======================================
  Files         169      169           
  Lines       50694    50694           
=======================================
  Hits        46671    46671           
  Misses       4023     4023
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.47% <100%> (ø)` | :arrow_up: |
| #single | `42.32% <0%> (ø)` | :arrow_up: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/22187?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/strings.py](https://codecov.io/gh/pandas-dev/pandas/pull/22187/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvc3RyaW5ncy5weQ==) | `98.63% <100%> (ø)` | :arrow_up: |

------

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

thanks @IsvenC
implement masked_arith_op to de-duplicate ops code
State: closed

ATM _arith_method_SERIES and _arith_method_FRAME have really similar fallback code.  This de-duplicates those.

- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`


Labels:
name: Refactor
description: Internal refactoring of code
name: Algos
description: Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff

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

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

```diff
@@            Coverage Diff             @@
##           master   #22182      +/-   ##
==========================================
+ Coverage   92.08%   92.08%   +<.01%     
==========================================
  Files         169      169              
  Lines       50704    50695       -9     
==========================================
- Hits        46691    46683       -8     
+ Misses       4013     4012       -1
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.49% <100%> (ø)` | :arrow_up: |
| #single | `42.34% <7.69%> (ø)` | :arrow_up: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/22182?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/ops.py](https://codecov.io/gh/pandas-dev/pandas/pull/22182/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvb3BzLnB5) | `96.56% <100%> (+0.09%)` | :arrow_up: |

------

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

looks ok, if you can comment a bit more, this consolidates a gnarly bit of code, which is full of special cases. and rebase.
> this consolidates a gnarly bit of code, which is full of special cases

Yah.  A bunch of it we'll be able to simplify after #22163, #22019, and the not-yet-written third PR in that sequence make a bunch of it unnecessary.
thanks
Standardize special case in tz_conversion functions
State: closed

ATM `_tz_convert_dst` handles iteration and masking differently (and more complicated-ly) than other related functions.  AFAICT the reasoning is that this implementation is performant when the passed `vals` have a high proportion of `iNaT`s.

By changing this special case to conform to the standard pattern, we allow other functions to call this without having to do any special casting, generally simplify things, and open the door to de-duplicating these functions (which this PR also starts doing by implementing `_tz_convert`)

- [ ] closes #xxxx
- [ ] tests added / passed
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry


Labels:
name: Timezones
description: Timezone data dtype
name: Clean

Comments:
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/22181?src=pr&el=h1) Report
> Merging [#22181](https://codecov.io/gh/pandas-dev/pandas/pull/22181?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/def50e26f78c507a743fa11fee98230412ae50a8?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/22181/graphs/tree.svg?width=650&height=150&token=eZ4WkYLtcO&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/22181?src=pr&el=tree)

```diff
@@           Coverage Diff           @@
##           master   #22181   +/-   ##
=======================================
  Coverage   92.06%   92.06%           
=======================================
  Files         169      169           
  Lines       50694    50694           
=======================================
  Hits        46671    46671           
  Misses       4023     4023
```

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


------

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

thanks!