BrandonFors/pandas-github-issues huggingface dataset:
BUG: Fix filter method so that accepts byte and unicode column names
State: closed

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


Labels:
name: Bug
name: Unicode
description: Unicode strings

Comments:
Hello @Licht-T! Thanks for updating the PR.







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

##### Comment last updated on November 21, 2017 at 16:25 Hours UTC
Thanks @jreback, now fixed!
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/18238?src=pr&el=h1) Report
> Merging [#18238](https://codecov.io/gh/pandas-dev/pandas/pull/18238?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/c4a2cd362afdfbc21cb62a8e09758226e86735c4?src=pr&el=desc) will **decrease** coverage by `0.02%`.
> The diff coverage is `73.33%`.

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

```diff
@@            Coverage Diff             @@
##           master   #18238      +/-   ##
==========================================
- Coverage   91.36%   91.34%   -0.03%     
==========================================
  Files         164      164              
  Lines       49733    49743      +10     
==========================================
- Hits        45439    45436       -3     
- Misses       4294     4307      +13
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `89.14% <73.33%> (-0.01%)` | :arrow_down: |
| #single | `39.61% <13.33%> (-0.07%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/18238?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/generic.py](https://codecov.io/gh/pandas-dev/pandas/pull/18238?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ2VuZXJpYy5weQ==) | `95.73% <100%> (ø)` | :arrow_up: |
| [pandas/compat/\_\_init\_\_.py](https://codecov.io/gh/pandas-dev/pandas/pull/18238?src=pr&el=tree#diff-cGFuZGFzL2NvbXBhdC9fX2luaXRfXy5weQ==) | `58.18% <60%> (+0.08%)` | :arrow_up: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/18238?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `25% <0%> (-58.34%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/18238?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.8% <0%> (-0.1%)` | :arrow_down: |

------

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

thanks @Licht-T very nice!
Implement _get_lastbday
State: closed

Orthogonal to other PRs.

Implement `_get_lastbday` mirroring `_get_firstbday`.

Add a dummy argument to get_firstbday so that the signatures match.  Following this and #18218, we'll be able to define e.g.

```
class BQuarterBegin(...):
    _get_bday = _get_firstbday

class BMonthEnd(...):
    _get_bday = _get_lastbday
```

etc.  From there we can get rid of _bunch_ of duplicated logic.



Labels:

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

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

```diff
@@            Coverage Diff             @@
##           master   #18234      +/-   ##
==========================================
- Coverage   91.43%   91.39%   -0.05%     
==========================================
  Files         163      163              
  Lines       50091    50092       +1     
==========================================
- Hits        45800    45780      -20     
- Misses       4291     4312      +21
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `89.2% <100%> (-0.03%)` | :arrow_down: |
| #single | `40.36% <7.14%> (-0.06%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/18234?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/tseries/offsets.py](https://codecov.io/gh/pandas-dev/pandas/pull/18234?src=pr&el=tree#diff-cGFuZGFzL3RzZXJpZXMvb2Zmc2V0cy5weQ==) | `97.11% <100%> (ø)` | :arrow_up: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/18234?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `25% <0%> (-58.34%)` | :arrow_down: |
| [pandas/plotting/\_converter.py](https://codecov.io/gh/pandas-dev/pandas/pull/18234?src=pr&el=tree#diff-cGFuZGFzL3Bsb3R0aW5nL19jb252ZXJ0ZXIucHk=) | `63.38% <0%> (-1.82%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/18234?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.8% <0%> (-0.1%)` | :arrow_down: |

------

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

Too many open PRs, need to exercise restraint. Closing.
BUG: MultiIndex not raising AttributeError with a million records
State: closed

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


Labels:
name: Error Reporting
description: Incorrect or improved errors from pandas
name: MultiIndex

Comments:
@jreback moved to v0.21.1
thanks!
DOC: small whatsnew updates
State: closed


Labels:
name: Docs

Comments:
this may not be exactly correct from a doc perspective (and prob adds some warnings), but getting the data in the right place for now.
A bit late (could also keep such things open a bit longer), but:

- I would for now not add more classes to the api.rst until we figure out the api issues (how to not add all its members), so the task to fix that does not become larger
- in general when adding things to api.rst, we should make sure they have actually docstrings. Now almost all the classes added have empty pages.
right this was mainly to get things started
Add requirement for a 1-dimensional ndarray in the `pd.qcut` docstring
State: closed

- [x] closes #18173 

`pd.qcut` only accepts 1-dimensional numpy arrays, which is not mentioned in the docstring. This PR  updates the docstring accordingly.

Labels:
name: Docs

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

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

```diff
@@            Coverage Diff             @@
##           master   #18211      +/-   ##
==========================================
+ Coverage    91.4%    91.4%   +<.01%     
==========================================
  Files         163      163              
  Lines       50064    50064              
==========================================
+ Hits        45760    45763       +3     
+ Misses       4304     4301       -3
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `89.21% <ø> (+0.02%)` | :arrow_up: |
| #single | `40.36% <ø> (-0.06%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/18211?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/reshape/tile.py](https://codecov.io/gh/pandas-dev/pandas/pull/18211?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvcmVzaGFwZS90aWxlLnB5) | `90.25% <ø> (ø)` | :arrow_up: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/18211?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `25% <0%> (-58.34%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/18211?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.8% <0%> (-0.1%)` | :arrow_down: |
| [pandas/plotting/\_converter.py](https://codecov.io/gh/pandas-dev/pandas/pull/18211?src=pr&el=tree#diff-cGFuZGFzL3Bsb3R0aW5nL19jb252ZXJ0ZXIucHk=) | `65.2% <0%> (+1.81%)` | :arrow_up: |

------

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

thanks @jdoepfert 
thx @jreback !
Handle unsortable Periods correctly in set_index, MultiIndex
State: closed

3rd of 3 to address bugs in #17112

`set_index` goes through MultiIndex.from_arrays, which calls `factorize_from_iterables`... which tries to sort the inputs.  In cases like `Period`, sometimes the inputs can't be sorted.  But for the purposes of `set_index`, we don't actually _care_ about the order.  So we impose a reasonable fallback.

New tests are likely not in the correct place.  Pls advise.

Labels:
name: Error Reporting
description: Incorrect or improved errors from pandas
name: Period
description: Period data type

Comments:
Will revisit this later. Closing.
Catch SystemError in py3 Period.__richcmp__
State: closed

First of ~3 to fix bugs reported in #17112.  This just catches a py3-specific error in `Period.__richcmp__` and raises the correct error instead.  With a test that fails under the status quo.

Labels:
name: Error Reporting
description: Incorrect or improved errors from pandas
name: Period
description: Period data type

Comments:
this is just patching over the fundamental error, which is the ``self.freq != other.freq``. 
let's systematically test just this and try to repro, then this will be more clear.
>this is just patching over the fundamental error, which is the self.freq != other.freq.
let's systematically test just this and try to repro, then this will be more clear.

I agree on the patching over, but have gotten nowhere on actually figuring out what's going on.  Open to suggestions. 
> I agree on the patching over, but have gotten nowhere on actually figuring out what's going on. Open to suggestions.

print out the case where this happens (e.g. both values). then add a test which systematically goes thru all the possibilities (e.g. maybe its a string comparing an offset or something). Then we can see exactly where the error is. having systematic unit tests is very important for basic things like this.
I think there may be a problem in the CI.  Travis icon has said it is running for something like 2 days.
pls rebase on master and follow my comments above.
I'll try to follow that suggestion.  The CI thing might need human intervention.
> print out the case where this happens (e.g. both values). then add a test which systematically goes thru all the possibilities (e.g. maybe its a string comparing an offset or something).

AFAICT it isn't happening in scalar comparisons, only in index/series/frame sort_values (but _not_ sort_index).  The broken operations all seem to go through `values.argsort()`.

In offsets if I wrap `isinstance(other, compat.string_types)` in a try/except that returns False on error, the bug is fixed.  So the question is: what is it about `np.argsort` that messes with `isinstance`?
Closing because I'm concerned the never-ending Travis build may be clogging up the pipeline for others.  Will return to this bug eventually.
Allow accessing AxisProperties on classes
State: closed

xref https://github.com/pandas-dev/pandas/issues/18147

This will remove the doc warnings about DataFrame.index, Series.index, ...

Basically, before if you did `pd.DataFrame.index` you got an exception, about `None._data`, since there was no instance.

cc @jreback if you have any concerns.

Labels:
name: Docs

Comments:
Thanks!
cleanup import order for core.indexes
State: closed

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


Labels:

Comments:
This is just taking a bite out of #18151
i would like to put a flake check on this first before we change anything then selectively change 

right now these things are changed a fair amount depending on people’s editors
Sure, this isn't really a priority.

w/r/t the linter, I've found flake8-import-order can be borderline too strict.  Generally the convention I find useful is `__future__` --> stdlib --> 3rdParty --> same_package_but_different_subpackage --> same_subpackage.
move remaining core.tools.timedeltas to tslibs.timedeltas
State: closed

Moves remaining contents of core.tools.timedeltas to tslibs.timedeltas.  Several can be cut/paste directly.  A few changes were made in moving `_convert_listlike` and `to_timedelta` up into tslibs.timedeltas.

- instead of using `is_list_like` (not implemented in cython), directly exclude str-like case and then check `hasattr(arg, '__iter__')`.
- instead of using `is_timedelta64_dtype(arg)`, check that arg is an ndarray and then use `arg.dtype.kind == 'm'`.  Analogous for `is_integer_dtype`.

Updates imports.

Labels:

Comments:
> instead of using is_timedelta64_dtype(arg), check that arg is an ndarray and then use arg.dtype.kind == 'm'. Analogous for is_integer_dtype.

these are pretty non standard and would like to avoid 
> these are pretty non standard and would like to avoid

Prefer a runtime import of the non-cython funcs?
> also instead of going to new areas can work in trimming the existing list?

Ha fair enough.  Will close now, may revisit down the road.
CLN: remove obsolete scripts
State: closed

closes #13704

Labels:
name: Admin
description: Administrative tasks related to the pandas project
name: Clean

Comments:
cc @wesm @jorisvandenbossche @TomAugspurger 

speak now or forever hold your peace
> speak now or forever hold your peace

speak now or look in the git history :-)

Therefore, big +1
Out of curiosity, does somebody use `find_commits_touching_func.py` ?
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/18181?src=pr&el=h1) Report
> Merging [#18181](https://codecov.io/gh/pandas-dev/pandas/pull/18181?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/8dac633142daa8d5bcd0cf77ad89b97628d474eb?src=pr&el=desc) will **decrease** coverage by `0.01%`.
> The diff coverage is `n/a`.

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

```diff
@@            Coverage Diff             @@
##           master   #18181      +/-   ##
==========================================
- Coverage   91.42%    91.4%   -0.02%     
==========================================
  Files         163      163              
  Lines       50068    50068              
==========================================
- Hits        45776    45766      -10     
- Misses       4292     4302      +10
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `89.21% <ø> (-0.01%)` | :arrow_down: |
| #single | `40.36% <ø> (-0.06%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/18181?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/18181?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `25% <0%> (-58.34%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/18181?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.8% <0%> (-0.1%)` | :arrow_down: |
| [pandas/core/indexes/datetimes.py](https://codecov.io/gh/pandas-dev/pandas/pull/18181?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9kYXRldGltZXMucHk=) | `95.38% <0%> (-0.1%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/18181?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/18181?src=pr&el=footer). Last update [8dac633...f0130bd](https://codecov.io/gh/pandas-dev/pandas/pull/18181?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
offsets cleanup
State: closed

This is mostly a small cleanup of offsets, want to keep this fairly trivial diff from obscuring more important upcoming changes.

The two non-trivial things here are 1) implement `_Tick` class in offsets.pyx with the most basic of its methods and 2) optimization of `Tick.__hash__`.  You'd be surprised how big a difference this particular optimization makes:

Before:
```
In [2]: day = pd.offsets.Day(2)
In [3]: %timeit hash(day)
100000 loops, best of 3: 11.7 µs per loop
```

After
```
In [3]: day = pd.offsets.Day(2)
In [5]: %timeit hash(day)
The slowest run took 8.61 times longer than the fastest. This could mean that an intermediate result is being cached.
100000 loops, best of 3: 1.86 µs per loop
```

Labels:
name: Performance
description: Memory or execution speed performance
name: Frequency
description: DateOffsets
name: Clean

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



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

##### Comment last updated on November 08, 2017 at 17:32 Hours UTC
also add a note in perf for 0.22; as you make more changes u can add those issue numbers in (PR numbers)
There's a lot of upcoming work in offsets.  Luckily it isn't all cut/paste, so it won't be quite the deluge of PRs.  Going to put together a thorough set of asvs; will remove the optimization and make this pure-cleanup for now.
Yes

Sent from my iPhone

> On Nov 8, 2017, at 12:17 PM, Jeff Reback <notifications@github.com> wrote:
> 
> @jreback requested changes on this pull request.
> 
> In pandas/tseries/offsets.py:
> 
> > @@ -1227,12 +1227,7 @@ def onOffset(self, dt):
>          if self.normalize and not _is_normalized(dt):
>              return False
>          first_weekday, _ = tslib.monthrange(dt.year, dt.month)
> -        if first_weekday == 5:
> -            return dt.day == 3
> is this the same logic?
> 
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub, or mute the thread.
> 

linting issue & rebase
would like to have some benchmark asv's here as well.
COMPAT: install dateutil from master
State: closed

xref #18157 

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

Comments:
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/18172?src=pr&el=h1) Report
> Merging [#18172](https://codecov.io/gh/pandas-dev/pandas/pull/18172?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/8dac633142daa8d5bcd0cf77ad89b97628d474eb?src=pr&el=desc) will **decrease** coverage by `0.01%`.
> The diff coverage is `n/a`.

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

```diff
@@            Coverage Diff             @@
##           master   #18172      +/-   ##
==========================================
- Coverage   91.42%    91.4%   -0.02%     
==========================================
  Files         163      163              
  Lines       50068    50068              
==========================================
- Hits        45776    45767       -9     
- Misses       4292     4301       +9
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `89.21% <ø> (ø)` | :arrow_up: |
| #single | `40.36% <ø> (-0.06%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/18172?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/18172?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `25% <0%> (-58.34%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/18172?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.8% <0%> (-0.1%)` | :arrow_down: |

------

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

don't merge, waiting for a fix in dateutil/dateutil master