BrandonFors/pandas-github-issues huggingface dataset:
ERR: improves message raised for bad names in usecols (GH14154)
State: closed

- [X] partial fix for #14154
- [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: IO CSV
description: read_csv, to_csv

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

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

``` diff
@@             master     #14163   diff @@
==========================================
  Files           139        139          
  Lines         50502      50502          
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
- Hits          43055      43051     -4   
- Misses         7447       7451     +4   
  Partials          0          0          
```

> Powered by [Codecov](https://codecov.io?src=pr). Last update [e54d4db...1a34b2a](https://codecov.io/gh/pydata/pandas/compare/e54d4dbd96db243d041ce14f305c538fd0eb7104...1a34b2a94775d21db0c0df78a5e68a615f69a5cf?src=pr)

@aechase Do you have time to update this?

@jorisvandenbossche I'll take another look at it next week. I discovered that this error message gets raised in several (redundant) places, which made it a more complex issue than I originally had time for.

we just updated some usecols functionaility, so if you could rebase would be great.
can you rebase
@jreback I'm afraid I'm not going to have time to look at this for at least a couple of weeks.
closing as stale. please ping if you'd like to continue.
TST: Make encoded sep check more locale sensitive
State: closed

Follow-up to #14120 to make the `sep` check more locale sensitive.  Closes #14140.


Labels:
name: Testing
description: pandas testing functions or related to the test suite
name: IO CSV
description: read_csv, to_csv

Comments:
ok looks fine
ping on all green 

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

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

``` diff
@@             master     #14161   diff @@
==========================================
  Files           140        140          
  Lines         50549      50555     +6   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits          43090      43095     +5   
- Misses         7459       7460     +1   
  Partials          0          0          
```

> Powered by [Codecov](https://codecov.io?src=pr). Last update [02df7b6...4f3d833](https://codecov.io/gh/pydata/pandas/compare/02df7b683734cafd87ad7b5920dd2a628521999c...4f3d833d7d4a618e9714ac4efe03ab4f2fdce912?src=pr)

doesn't appear to fix the issue. https://github.com/pydata/pandas/commit/1a8273cfa9d835fcc377a020c16bc6d55a9ad98b skipping for now (pls reverse in your commit)

@jreback : Okay, thanks for letting me know.  I might need to do some hackish commits to debug what Appveyor is doing with regards to locale.

@jreback : Just as I thought.  The system encoding used on Appveyor Python 3.5 is one that will actually encode the separator properly (see <a href="https://ci.appveyor.com/project/jreback/pandas-465/build/1.0.1006/job/4idc6de9oawlgutm">here</a>).  I can also confirm on my local Windows machine.

The test is flaky across Appveyor and Travis, so I think it is best to remove or disable.

fine to remove/disable

@jreback : Removed the test.  Ready to merge if there are no other concerns.

thanks
BUG : assignment of non-ns timedelta64 value (GH14155)
State: closed

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


Labels:
name: Bug
name: Indexing
description: Related to indexing on series/frames, not to indexes themselves
name: Timedelta
description: Timedelta data type

Comments:
tests might be in tseries/test_timedelta.py but more likely in index/test_indexing.py

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

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

``` diff
@@             master     #14160   diff @@
==========================================
  Files           140        140          
  Lines         50549      50549          
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
  Hits          43091      43091          
  Misses         7458       7458          
  Partials          0          0          
```

> Powered by [Codecov](https://codecov.io?src=pr). Last update [1ace12b...dce11f0](https://codecov.io/gh/pydata/pandas/compare/1ace12b7473e6444f7bbd56f90343ca7638570c3...dce11f0c60cdab426532565a45437599e550eb47?src=pr)

Added the call to other, and added a test in `tests/series/test_indexing.py`.  Please let me know if there is any other comments or changes needed.

I have edited the `whatsnew` to be a bit clearer, changed `ix` to `loc`, and fixed the problems with PEP8.

minor comments. lgtm. ping on green.

@jreback , looks like all checks have passed.  Let me know if there is anything else I can do.

@rsmith54 Maybe something went wrong with committing the changes, but it seems the `Timedelta(np.timedelta64(other))` has not changed

lgtm.

thanks!
WIP/ENH: reading older Stata versions, #11526
State: closed

A simple file seems to read OK if we just treat it like other "old format" (version 104-115) files.  However I do not currently have any documentation for this format.  The only relevant resource I can find is the file `foreign/src/stataread.c` in the R `foreign` package sources:

https://cran.r-project.org/src/contrib/foreign_0.8-66.tar.gz

It suggests some special handling for version 111 but I haven't had time to figure out exactly what it is doing.
- [x] closes #11526 
- [x] tests added / passed
- [x] passes `git diff upstream/master | flake8 --diff`
- [x] whatsnew entry


Labels:
name: IO Stata
description: read_stata, to_stata

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

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

``` diff
@@             master     #14159   diff @@
==========================================
  Files           140        140          
  Lines         50563      50563          
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
  Hits          43101      43101          
  Misses         7462       7462          
  Partials          0          0          
```

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

can you add a whatnew in Bug Fixes. ping on green.

can you rebase and push again

@jreback I don't understand the issue with appveyor here

need to rebase on master

@jreback, looks OK now

thanks!
Fix typo (change 'n' to 'k' in get_dummies documentation)
State: closed

Just changing an `n` to a `k`.


Labels:

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

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

``` diff
@@             master     #14153   diff @@
==========================================
  Files           139        139          
  Lines         50502      50502          
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
  Hits          43058      43058          
  Misses         7444       7444          
  Partials          0          0          
```

> Powered by [Codecov](https://codecov.io?src=pr). Last update [900ae6b...d725192](https://codecov.io/gh/pydata/pandas/compare/900ae6bfd4a940f7a165ba2635eb590952f0ce84...d72519257802dc7a05061b1deae98ec314dfda27?src=pr)

Thanks!
BUG/TST: Empty input arrays in cartesian_product and MultiIndex (#12258)
State: closed

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

This commit:
1. fixes logic (and division by 0) in `cartesian_product` when some input arrays are empty
2. adds tests for MultiIndex empty level  construction with `.from_arrays` and `.from_product`


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

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

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

``` diff
@@             master     #14151   diff @@
==========================================
  Files           140        140          
  Lines         50579      50593    +14   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits          43121      43137    +16   
+ Misses         7458       7456     -2   
  Partials          0          0          
```

> Powered by [Codecov](https://codecov.io?src=pr). Last update [7dedbed...b831516](https://codecov.io/gh/pydata/pandas/compare/7dedbed8988db9dc6453320383202bf97deaf14a...b83151619379435b3a8236d9de378eb5b263768b?src=pr)

ping when updated / green.

@jreback Sorry for the delay. I'll try to get to it before the weekend. 

I think I'll have to touch also `_factorize_from_iterable(s)` - they have small issues with empty or incorrect inputs.

@jreback It took me longer than I expected.
Added some checks and tests for incorrect input.
MAINT: flake8 *.pyx files
State: closed

closes #12995 

flake8-ed *.pyx files and fixed errors.

Removed the E226 check because that inhibits pointers (e.g. char*). In addition, the check is not even universally accepted in Python.


Labels:
name: Code Style
description: Code style, linting, code_checks

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

> No coverage report found for **master** at 3110a72.
> 
> Powered by [Codecov](https://codecov.io?src=pr). Last update [3110a72...5677916](https://codecov.io/gh/pydata/pandas/compare/3110a72b5388f60de2cd287359e020f7c135b5e5...56779165b111e8de7720a2e159595f8743c61d58?src=pr)

not sure what u mean E226 is not universally accepted

pls turn it back on

ok, forget about E226, its not so easy to remove.

can you add E128 back to the `.pxi.in` as well.

@jreback : I'm actually surprised that all of these `flake8` tests passed. :smile: In any case, do you think we can postpone the `pxi.in` changes until a separate PR?  This `pyx` change is massive enough as it is.

no this needs fixing here as u edited the .pyx for algos and join which are auto generated and will revert when the pxi.in are changed 

@jreback : Ah, fair enough.  Will fix then.

@jreback : On second look, what do you mean that `algos.pyx` is auto-generated?  I believe you mean `algos*.pxi` are auto-generated.  Those are not the same files.

right the .pxi are included at cythonization time
so if u only edited .pyx then ok

@jreback : Nice!  You got Appveyor to work and now block this PR :smile: :angry: 

At least Appveyor is not failing because of my PR.  Need to fix that 3.5 failure with the locale.

oh that's great!

and I stole from numpy a line in appveyor.yml
it cancels the previous if u push again :)
unlike Travis 

thanks!
BUG: DatetimeTZBlock can't assign values near dst boundary
State: closed

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

Value assignment doesn't work if data contains DST boundary because of internal `.localize(None)`. 

```
s = pd.Series(pd.date_range('2016-11-06', freq='H', periods=3, tz='US/Eastern'))
s[1] = pd.Timestamp('2011-01-01', tz='US/Eastern')
s
#0   2016-11-06 00:00:00-04:00
#1   2016-11-06 01:00:00-04:00
#2   2016-11-06 01:00:00-05:00
# dtype: datetime64[ns, US/Eastern]
```


Labels:
name: Bug
name: Dtype Conversions
description: Unexpected or buggy dtype conversions
name: Timezones
description: Timezone data dtype

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

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

``` diff
@@             master     #14146   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...95aa6b5](https://codecov.io/gh/pydata/pandas/compare/289cd6d0df66b812921ff4c5cbade937b875406d...95aa6b5c78348b9f9d71cd58a3f1460b85edd2e6?src=pr)

@sinhrks just that question from above.

thanks!
BUG: Don't print stray newline with MultiIndex
State: closed

Title is self-explanatory.

Closes #6618.


Labels:
name: Output-Formatting
description: __repr__ of pandas objects, to_string
name: IO CSV
description: read_csv, to_csv

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

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

``` diff
@@             master     #14132   diff @@
==========================================
  Files           139        139          
  Lines         50553      50554     +1   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
  Hits          43110      43110          
- Misses         7443       7444     +1   
  Partials          0          0          
```

> Powered by [Codecov](https://codecov.io?src=pr). Last update [58199c5...d1a600f](https://codecov.io/gh/pydata/pandas/compare/58199c5da263491a26fa6cb26d2ff9d38c4b5dac...d1a600f5fbc25a732ce8859db7e59d2936f49c8d?src=pr)

thanks!
API/DEPR: Remove +/- as setops for Index (GH8227)
State: closed

xref #13777, deprecations put in place in #8227
- [x] tests added / passed
- [x] passes `git diff upstream/master | flake8 --diff`
- [x] whatsnew entry


Labels:
name: API Design
name: Clean

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

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

``` diff
@@             master     #14127   diff @@
==========================================
  Files           139        139          
  Lines         50501      50495     -6   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
- Hits          43058      43051     -7   
- Misses         7443       7444     +1   
  Partials          0          0          
```

> Powered by [Codecov](https://codecov.io?src=pr). Last update [4488f18...dbcc655](https://codecov.io/gh/pydata/pandas/compare/4488f18076226894c0f07be67ee700663e32623e...dbcc655b46d4992f0f0e272268c90478fd392362?src=pr)

@jorisvandenbossche we should do this for the RC as well.

@jreback yep, as it is quite a substantial change (for people that ignored the warnings)

Is there a reason that we do not allow numeric ops for the base Index class? (eg `pd.Index(['a', 'b']` could have a clear meaning, just letting the objects determine whether an operation can be handled)

Because eg the `__add__` in the `Index` class could benefit from the machinery in `_add_numeric_methods_binary` (eg to ensure attributes like `name` are passed correctly. Something that is also not correct on current master)

I think we don't allow numeric operations on Index as only possible one is **add** for string concat
nothing else makes sense

in general these r not well defined so no reason to allow

I think we should let the objects in the Index decide whether the numeric operation is valid or not. This is the approach NumPy uses for object dtype. For example, one might put decimal objects in a pandas.Index.

the numpy approach leads to lots of bugs and edge cases - constraining things somewhat to not allowing everything on everything is much more user friendly 

decimal objects in an Index are a disaster - should not be encouraged 

@jorisvandenbossche some small comments, but otherwise lgtm. merge when ready.
Make show_versions not to reload modules (GH13684)
State: closed

closes #13684 


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

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

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

``` diff
@@             master     #14126   diff @@
==========================================
  Files           139        139          
  Lines         50529      50531     +2   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
  Hits          43089      43089          
- Misses         7440       7442     +2   
  Partials          0          0          
```

> Powered by [Codecov](https://codecov.io?src=pr). Last update [47a8e71...74bfb21](https://codecov.io/gh/pydata/pandas/compare/47a8e713430707afcfe76e7ca995902628d4bccf...74bfb2178eb5da19d6e77e9f78ade9b721cf120d?src=pr)

lgtm.
WIP: API: Add support for PEP 519 / file system path protocol
State: closed

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


Labels:
name: IO Data
description: IO issues that don't fit into a more specific label

Comments:
needs tests

@AnkurDedania Do you have time to update this and add tests?
can you rebase / update
TIL how to rebase, if done correctly
It seems the rebase worked! 
Can you add some tests?
also need to add a ``skip_if_no_fspath`` in ``pandas.util.testing`` (again alongside pathlib, py.path ones)
@AnkurDedania ca you rebase / update
@AnkurDedania something went wrong.

try

```
git rebase -i origin/master
```

then
```
git push yourremote yourbrach -f
```
closing, you can cherry-pick your changes on top of master. ps open a new PR.
BUG: #14095. Amend eval() resolvers kwarg to accept lists
State: closed

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


Labels:
name: Bug

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

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

``` diff
@@             master     #14121   diff @@
==========================================
  Files           139        139          
  Lines         50511      50537    +26   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits          43071      43097    +26   
  Misses         7440       7440          
  Partials          0          0          
```

> Powered by [Codecov](https://codecov.io?src=pr). Last update [10bf721...227d734](https://codecov.io/gh/pydata/pandas/compare/10bf7213240eaa0960f50f86c7790d64d8973060...227d734807ee018ac0ba74178347b9dd2c6e4a58?src=pr)

This should also be tested (and may need a fix) for `pd.eval`

`pd.eval` seems ok taking a list or tuple

@theultimatecrouton can you add a test for `pd.eval` as well. otherwise lgtm.

Added

thanks!
API: Warn or raise for > 1 char encoded sep
State: closed

The system file encoding can cause a separator to be encoded as more than one character even though it maybe provided as one character.  Multi-char separators are not supported by the C engine, so we need to catch this case.

Closes #14065.


Labels:
name: Unicode
description: Unicode strings
name: IO CSV
description: read_csv, to_csv

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

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

``` diff
@@             master     #14120   diff @@
==========================================
  Files           139        139          
  Lines         50511      50517     +6   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits          43071      43078     +7   
+ Misses         7440       7439     -1   
  Partials          0          0          
```

> Powered by [Codecov](https://codecov.io?src=pr). Last update [10bf721...152b685](https://codecov.io/gh/pydata/pandas/compare/10bf7213240eaa0960f50f86c7790d64d8973060...152b6851120d6b785797817879cd47e81c93e257?src=pr)

do we need an additional test for this?

Test is in `test_unsuppported.py`, and that should be sufficient.

thanks!
BUG: series resample with timedelta values looses dtype (GH13119)
State: closed

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


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

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

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

``` diff
@@             master     #14118   diff @@
==========================================
  Files           139        139          
  Lines         50511      50511          
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits          43071      43072     +1   
+ Misses         7440       7439     -1   
  Partials          0          0          
```

> Powered by [Codecov](https://codecov.io?src=pr). Last update [10bf721...c06ac1e](https://codecov.io/gh/pydata/pandas/compare/10bf7213240eaa0960f50f86c7790d64d8973060...c06ac1e09e958dd9bc9ff3ba58a90a1e76154e2c?src=pr)