BrandonFors/pandas-github-issues huggingface dataset:
TST: Cleanup test_indexing
State: closed

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

cleaned up `test_indexing` which is bit large, splitting `@slow` tests to a separate file.


Labels:
name: Testing
description: pandas testing functions or related to the test suite
name: Clean

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

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

``` diff
@@             master     #13982   diff @@
==========================================
  Files           139        139          
  Lines         50206      50206          
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
  Hits          42818      42818          
  Misses         7388       7388          
  Partials          0          0          
```

> Powered by [Codecov](https://codecov.io?src=pr). Last update [29d9e24...3947468](https://codecov.io/gh/pydata/pandas/compare/29d9e24f4c778b0c9ebe9288bfc217808d2c6edb...3947468defcf55c815a117e9babb530e9097a5a3?src=pr)

@sinhrks Did you just move part of the file test_indexing.py to a new file (split up)? (github won't show the diff ..)

Yeah moved some tests to another file and fixed formats. Doesn't change tests itself. 

thanks @sinhrks you are really putting lots of PR's up! fantastic!
BUG: Index may ignore specified datetime/timedelta dtypes
State: closed

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

`Index` ignores specified `dtype` if it is `datetime64` (normal and tz) or `timedelta64`. This PR makes it consistent with `DatetimeIndex` and `TimedeltaIndex`.

```
pd.Index([1, 2, 3], dtype='datetime64[ns, US/Eastern]')
# Index([1, 2, 3], dtype='object')
pd.Index([1, 2, 3], dtype='datetime64[ns]')
# Index([1, 2, 3], dtype='object')
pd.Index([1, 2, 3], dtype='timedelta64[ns]')
# Int64Index([1, 2, 3], dtype='int64')
```

Also, fixed `MultiIndex.get_level_values` not to pass unnecessary `tz` and `freq`.


Labels:
name: Bug
name: Datetime
description: Datetime data dtype
name: Dtype Conversions
description: Unexpected or buggy dtype conversions
name: Timedelta
description: Timedelta data type

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

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

``` diff
@@             master     #13981   diff @@
==========================================
  Files           139        139          
  Lines         50206      50205     -1   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
- Hits          42818      42810     -8   
- Misses         7388       7395     +7   
  Partials          0          0          
```

> Powered by [Codecov](https://codecov.io?src=pr). Last update [29d9e24...a922aef](https://codecov.io/gh/pydata/pandas/compare/29d9e24f4c778b0c9ebe9288bfc217808d2c6edb...a922aefa1b40178616d890ca2cfe3f897cb497e6?src=pr)

thanks!

@sinhrks Is it correct that you introduced the `tz` keyword in `Index` in this PR? 
Personally I don't think this is needed (it is also not documented).

To be clear, the fact that `dtype` is no longer ignored in `Index` is a nice bug fix! My comment is only about the tz keyword.

tz is NOT in the Index signature but you can pass kwargs generally

@jorisvandenbossche prior to this PR, passing `tz` kwd coerces to `DatetimeIndex` in some cases. This PR makes it consistent.
- https://github.com/pydata/pandas/blob/master/pandas/indexes/base.py#L267

`tz` was previously passed through to  when you already had datetime data, eg:

```
In [10]: pd.Index([datetime.datetime(2012,1,1), datetime.datetime(2012,1, 2)], tz="Europe/Brussels")
Out[10]: DatetimeIndex(['2012-01-01 00:00:00+01:00', '2012-01-02 00:00:00+01:00'], dtype='datetime64[ns, Europe/Brussels]', freq=None)
```

But the consequence of this PR is that for example the following now also works:

```
In [82]: pd.Index([1, 2], tz="Europe/Brussels")
Out[82]: DatetimeIndex(['1970-01-01 00:00:00+01:00', '1970-01-01 00:00:00+01:00'], dtype='datetime64[ns, Europe/Brussels]', freq=None)
```

I personally don't think this should work like that .. (a bit too much magic).
BUG: ufunc with PeriodIndex may raise IncompatibleFrequency
State: closed

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

`PeriodIndex` supportds addition / subtraction with integer.

```
# OK
pi = pd.PeriodIndex(['2011-01'], freq='M')
pi + 1
# PeriodIndex(['2011-02'], dtype='int64', freq='M')
pi - 1
# PeriodIndex(['2010-12'], dtype='int64', freq='M')
```

but raises if op is performed via ufunc.

```
# NG
np.add(pi, 1)
# pandas._period.IncompatibleFrequency: Input has different freq from PeriodIndex(freq=M)

np.subtract(pi, 1)
# pandas._period.IncompatibleFrequency: Input has different freq from PeriodIndex(freq=M)
```


Labels:
name: Bug
name: Period
description: Period data type
name: Compat
description: pandas objects compatability with Numpy or Python functions

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

> No coverage report found for **master** at 1919e26.
> 
> Powered by [Codecov](https://codecov.io?src=pr). Last update [1919e26...f94d027](https://codecov.io/gh/pydata/pandas/compare/1919e26ead5d156c2b505a0ad8d233b02eb1b573...f94d0271dea2d4808743493421da989f91231a68?src=pr)

thanks!

can revisit #13988 with these changes.
BUG: yield correct Series subclass in df.iterrows() (#13977)
State: closed

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


Labels:
name: Bug

Comments:
pls read the instructions. we explicity call for tests.

Ah, sorry. I made sure existing tests passed. Now I also added a new one.

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

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

``` diff
@@             master     #13978   diff @@
==========================================
  Files           139        139          
  Lines         50455      50447     -8   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
- Hits          43026      43018     -8   
  Misses         7429       7429          
  Partials          0          0          
```

> Powered by [Codecov](https://codecov.io?src=pr). Last update [6645b2b...2820315](https://codecov.io/gh/pydata/pandas/compare/6645b2b11a82343e5f07b15a25a250f411067819...282031597e9ee8e57d880b31309db768e834dda7?src=pr)

minor changes. ping when green.

Revised. Hope it's ok.

I did notice some more `Series` and `DataFrame` calls where `self._constructor_sliced` or `self._constructor` might make sense (e.g. in `DataFrame.apply()` and submethods). What is the rationale for ever using `Series` instead of `self._constructor_sliced`?

Thx for the update. Yes fixing relevant cases are appreciated (OK for separate PR).  The remaining normal constructor is mostly because of historical reason, and can be replaced to `constructor...`. 

But what are relevant cases? If `DataFrame._constructor` must always be a subtype of `DataFrame` (and so on for `_constructor_sliced` and `_constructor_expanddim`), why not just do a mass renaming of `DataFrame` into `self._constructor` (etc.) in all methods?

Using Python's `inspect` module, one could even write a simple test ensuring no references to Series, DataFrame and Panel are hardcoded. :bulb: 

It's simply because no one can take a time to do it (add tests). Note that sigatures must be changed sometimes, see #13208. 

Thanks, will look into it.

Adding just `__finalize__()` made [tests no longer pass](https://travis-ci.org/pydata/pandas/jobs/152388376#L1018).

I added a RFC commit with one proposed solution. It basically makes only DataFrame inherit DataFrame's _metadata properties, Series Series', and so on. I don't know whether this opposes any established behavior / documentation. Doesn't seem to. The tests will pass. :pray: 

the inheriting of metadata should be on a like object. However this would belong in another PR.

@kernc thx for theck. I've thought `finalize` has been generally called, sorry. 

So this appears to be it for this PR. I'll be opening the other one shortly. Thanks.

lgtm. ping on green.

So this is green. I'm not sure why Xcode build is marked as failed.

thanks!
CLN: PeriodIndex to use nan related cache
State: closed

- [x] no tests added (all cases look to be covered) / passed
- [x] passes `git diff upstream/master | flake8 --diff`


Labels:
name: Clean

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

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

``` diff
@@             master     #13975   diff @@
==========================================
  Files           139        139          
  Lines         50219      50216     -3   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
- Hits          42819      42816     -3   
  Misses         7400       7400          
  Partials          0          0          
```

> Powered by [Codecov](https://codecov.io?src=pr). Last update [4a80521...60b3351](https://codecov.io/gh/pydata/pandas/compare/4a805216d99b37955c97625d304980eff10cab56...60b3351e56c93a43468210345bb007c7d2304ba6?src=pr)

Looks good to me!

thanks!
BUG/DEPR: combine dtype fixes
State: closed

- [x] closes #7630, closes #10567 (fix `combine_first` dtype)
- [x] closes #13947 (`_find_common_type` to support extension types)
- [x] tests added / passed
- [x] passes `git diff upstream/master | flake8 --diff`
- [x] whatsnew entry
- `_find_common_type` also needs to handle numpy datetimelike to be compat with pandas because:

```
np.find_common_type([np.dtype('datetime64[ns]'), np.dtype('datetime64[ns]')], [])
# dtype('O')
```
- another `comibine_first` related issue  #7509 is NOT fixed because it is related to filling with `align`


Labels:
name: Bug
name: Reshaping
description: Concat, Merge/Join, Stack/Unstack, Explode
name: Dtype Conversions
description: Unexpected or buggy dtype conversions

Comments:
xref to #4094 (though that's another story)

very minor change. lgtm otherwise. ping when green.

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

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

``` diff
@@             master     #13970   diff @@
==========================================
  Files           139        139          
  Lines         50216      50206    -10   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits          42817      42818     +1   
+ Misses         7399       7388    -11   
  Partials          0          0          
```

> Powered by [Codecov](https://codecov.io?src=pr). Last update [70f361b...2046cb5](https://codecov.io/gh/pydata/pandas/compare/70f361ba78fd9385da469e5a13cca6e9685c8b1a...2046cb57a5871c618829e1772f35bc63147d8d13?src=pr)

Not really sure we should actually deprecate `DataFrame.combine`. Although I have never used it, it does serve a purpose that is not possible to achieve with "the flexible arithmetic methods like `add`" when you pass it a custom function (unlike the deprecated `combineAdd`, which definitely can be done with `add`)

I've commented on the original (#10734). 

ok, so as discussed in the issue. let's take out the combine deprecation from this PR. ping when ready.

Exclude `combine` deprecation, and now all green.

thanks!
BLD: add tempita files to depends
State: closed

This change makes it so that if a `.pxi.in` file is modified, the appropriate module will be rebuilt.


Labels:
name: Build
description: Library building on various platforms

Comments:
what's the repro on current master?

change an .in and everything recompiles?

Opposite - e.g., change `algos_take_helper.pxi.in` and nothing recompiles, if it was already up to date.

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

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

``` diff
@@             master     #13960   diff @@
==========================================
  Files           139        139          
  Lines         50164      50164          
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits          42788      42789     +1   
+ Misses         7376       7375     -1   
  Partials          0          0          
```

> Powered by [Codecov](https://codecov.io?src=pr). Last update [257ac88...d3ccf13](https://codecov.io/gh/pydata/pandas/compare/257ac884d61a74990d1cb4d72c48b1c9003298d5...d3ccf13d2057022c9e5121b1176a2da4e811e4db?src=pr)

Looks good to me

thanks!
CLN: Period cleanup related to array like meth
State: closed

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

removed unused / duplicated internal method returning array-likes. Also added some tests to guarantee existing API before fixing its dtype (see #13941).


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

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

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

``` diff
@@             master     #13955   diff @@
==========================================
  Files           139        139          
  Lines         50159      50157     -2   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
- Hits          42786      42782     -4   
- Misses         7373       7375     +2   
  Partials          0          0          
```

> Powered by [Codecov](https://codecov.io?src=pr). Last update [4df08a9...a75a718](https://codecov.io/gh/pydata/pandas/compare/4df08a9d9fcb679410743b97851899d60776b3b1...a75a7185776ddc5f343744371e82d6c506b427c9?src=pr)

ty!
DOC: remove rplot seaborn equivalent example figures
State: closed


Labels:
name: Docs

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

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

``` diff
@@             master     #13954   diff @@
==========================================
  Files           139        139          
  Lines         50159      50162     +3   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
  Hits          42785      42785          
- Misses         7374       7377     +3   
  Partials          0          0          
```

> Powered by [Codecov](https://codecov.io?src=pr). Last update [0e7ae89...9343486](https://codecov.io/gh/pydata/pandas/compare/0e7ae89115e60419b807c38b9e4b8a19d4c8f830...9343486b8682c9576cf449207736fe54461ef4b8?src=pr)
DOC: add whatsnew for #11920
State: closed

#11920 (forgot to add to commit when merging)


Labels:
name: Docs
name: IO SQL
description: to_sql, read_sql, read_sql_query

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

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

``` diff
@@             master     #13953   diff @@
==========================================
  Files           139        139           
  Lines         50159      52054   +1895   
  Methods           0          0           
  Messages          0          0           
  Branches          0          0           
==========================================
+ Hits          42786      44649   +1863   
- Misses         7373       7405     +32   
  Partials          0          0           
```

> Powered by [Codecov](https://codecov.io?src=pr). Last update [cce7993...24628c7](https://codecov.io/gh/pydata/pandas/compare/cce79936ca1790fe9870e8a5b6bccb3dba41b8ae...24628c75c05cd5c1e2f419b09045d43fb03661d9?src=pr)
DOC: NDFrame.to_hdf(data_columns) documented (#13061).
State: closed

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

I'm aware there's another PR for the same issue, but it hasn't had activity in a while so this is my attempt.  I took the opportunity to remove the unusable "mode=r" option from the same docstring, and make the title clearer.


Labels:
name: Docs
name: IO HDF5
description: read_hdf, HDFStore

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

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

``` diff
@@             master     #13951   diff @@
==========================================
  Files           139        139          
  Lines         50381      50381          
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
  Hits          42953      42953          
  Misses         7428       7428          
  Partials          0          0          
```

> Powered by [Codecov](https://codecov.io?src=pr). Last update [a01e58f...cfcca2f](https://codecov.io/gh/pydata/pandas/compare/a01e58fa780ed28f983e1a022b07e196e037d42a...cfcca2f37a5f085dbe3058049dc42e5892b1431e?src=pr)

@jreback Can you review this again?  I've updated it as per your previous comments.

thanks!
ENH: Improve error message for repeated Stata categories
State: closed

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

Improve the error message to be more explicit when attempting to read Stata
files containing repeated categories.

closes #13923


Labels:
name: Error Reporting
description: Incorrect or improved errors from pandas
name: IO Stata
description: read_stata, to_stata

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

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

``` diff
@@             master     #13949   diff @@
==========================================
  Files           139        139          
  Lines         50159      50169    +10   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits          42786      42792     +6   
- Misses         7373       7377     +4   
  Partials          0          0          
```

> Powered by [Codecov](https://codecov.io?src=pr). Last update [4df08a9...0880d02](https://codecov.io/gh/pydata/pandas/compare/4df08a9d9fcb679410743b97851899d60776b3b1...0880d0291c2ad9da69e705c643d457c1359de3ae?src=pr)

thanks! great as usual!
TST: Removed regex warning for read_csv
State: closed

Follow-up to #13481 and partially fixes #13932.  Regex mistakenly matches to the empty string, which will cause Python 3.x to issue a warning.  In addition, not sure why this test was placed in `python_parsers_only.py`...


Labels:
name: IO CSV
description: read_csv, to_csv

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

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

``` diff
@@             master     #13943   diff @@
==========================================
  Files           139        139          
  Lines         50157      50157          
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
- Hits          42785      42784     -1   
- Misses         7372       7373     +1   
  Partials          0          0          
```

> Powered by [Codecov](https://codecov.io?src=pr). Last update [b7abef4...b93325e](https://codecov.io/gh/pydata/pandas/compare/b7abef4949fb1ba7fd1004feba4f47ace7004282...b93325ee425d473a2e023029810cc077ee31c97c?src=pr)

ty!
BLD: Fix sparse warnings
State: closed

- [x] split from #13849 (comment)
- [x] tests added / passed
- [x] passes `git diff upstream/master | flake8 --diff`

Because sparse `IntIndex` and `BlockIndex` store value locations as `int32`, its size / block numbers can't exceed `int32` also.

warnings has been disappeared in appveyor. 
- https://ci.appveyor.com/project/sinhrks/pandas-2dhxb/build/1.0.669/job/2s24fpuxk3d2nrvq


Labels:
name: Build
description: Library building on various platforms
name: Sparse
description: Sparse Data Type

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

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

``` diff
@@             master     #13942   diff @@
==========================================
  Files           139        139          
  Lines         50157      50157          
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
- Hits          42785      42784     -1   
- Misses         7372       7373     +1   
  Partials          0          0          
```

> Powered by [Codecov](https://codecov.io?src=pr). Last update [b7abef4...16164fe](https://codecov.io/gh/pydata/pandas/compare/b7abef4949fb1ba7fd1004feba4f47ace7004282...16164fe337826a8dd37913476e0f4a6f3be17c51?src=pr)

thank you sir!