BrandonFors/pandas-github-issues huggingface dataset:
Adding more documentation for upsampling with replacement and error m…
State: closed

…essage in case replacement is set to False

- [X] closes #27451
- [x] tests added / passed
- [X] passes `black pandas`
- [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: Numeric Operations
description: Arithmetic, Comparison, and Logical operations

Comments:
Hello @CooperData! Thanks for updating this PR. We checked the lines you've touched for [PEP 8](https://www.python.org/dev/peps/pep-0008) issues, and found:





There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers: 

##### Comment last updated at 2019-11-07 23:38:05 UTC
lgtm. ping on green.
@jreback - CI failed but I am not sure what it's causing the issue. I was able to run the tests while I was at the sprint. But dont know if I did anything that is creating the issue.
see https://dev.azure.com/pandas-dev/pandas/_build/results?buildId=20307&view=logs&jobId=d6a36677-9147-59f9-684d-001fc5c44c5e

looks like just some extra white space 

fix and push up if u can
 I added a dot at the end of the raised error as per other errors I saw. I also changed the test msg checked to match the error raised so it's 2 lines as well. I was not able to understand what exactly the error was.
thanks @CooperData 
@jreback, I am going through the messages on the build for the last push, and it seems it's failing because the function inside that is supposed to give the error message is failing. In other words, the desired behavior is to make the test fail but compare the error message, not to make the test fail itself. 
The failures seem associated with something else that I did not change: [errors](https://dev.azure.com/pandas-dev/pandas/_build/results?buildId=20397&view=logs&jobId=5ddd427e-1f95-5998-4195-7ffbeb9b114d&taskId=607906cd-31fb-52fc-bb5f-740f55a1afa6&lineStart=150&lineEnd=186&colStart=1&colEnd=126)

thanks @CooperData !
TST: Add docstrings to arithmetic fixtures
State: closed

Relates to #19159

- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry


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

Comments:
Hello @dalgarno! Thanks for updating this PR. We checked the lines you've touched for [PEP 8](https://www.python.org/dev/peps/pep-0008) issues, and found:



There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers: 

##### Comment last updated at 2019-11-12 21:52:27 UTC
lgtm. side issue we should rename these to maybe ``one_value``and so on and move to pandas/conftest.py (but for another PR); also I believe we have *multiple* copies of these fixtures in various locations.
@WillAyd can you approve if you're happy?
Thanks @dalgarno
add unit tests for issue #19351
State: closed

- [x] closes #19351
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry

This is a unit test for an already fixed problem.


Labels:
name: Testing
description: pandas testing functions or related to the test suite
name: Reshaping
description: Concat, Merge/Join, Stack/Unstack, Explode

Comments:
thanks @acarl005 !
CLN: remove unnecessary check in MultiIndex
State: closed

We raise a ValueError and immediately ignore it.

Labels:
name: MultiIndex
name: Clean

Comments:
> We raise a ValueError and immediately ignore it.

this is an extra special technique!
> this is an extra special technique!

Yah, looks like this check was copied from the base class method and wrapped in a try/except for expedience
FYI ci all fixed now, just ping on green for the rest of the builds
thanks
CLN: core.computation, mostly typing
State: closed

cc @simonjayhawkins 

Largely using annotations as an excuse to put eyeballs on parts of the code that would otherwise be left alone.

Labels:
name: Clean

Comments:
can you  rebase this; like @simonjayhawkins to eyeball.
Closing to clear the queue
@jbrockmendel we should in general limit the number of asserts added to silence mypy.

for our established code base with extensive testing, then many mypy errors are false positives and it is frustrating to deal with them.

but in a few cases mypy is highlighting a potential issue where we would just move the failure to the assert by adding it.

The benefit of type checking will come downstream. (promise!) when new code is added, then mypy errors are more likely to pinpoint issues. This will  hopefully reduced the amount of time reviewing PRs since these issues will already have been picked up by mypy and hopefully the OP fixed it.
Pr09 batch 3
State: closed

part of #28602 

Labels:
name: Docs
name: Clean

Comments:
@jbrockmendel is there a guide somewhere that specifies what each label is used for? Thanks!
i dont understand the question.  what labels?
can you merge master & ping on green.
> @jbrockmendel is there a guide somewhere that specifies what each label is used for? Thanks!

no guide on the labels, they are *hopefully* self-explanatory :-> they are just to organize the issues & PRs
like the Docs label is self explanatory but I'm not sure what Clean is for. 

Is the failing test (probably) due to a missing commit from master? 
@jreback  all set.
thanks @HughKelley 

master was failing because of a numpy change; we disabled that build for now.

clean is just a generic label for internal cleaning.
CI: workaround numpydev bug
State: closed

We don't want this long-term. But there's no easy way
to skip this for numpydev, since it errors in setup.

xref #29432 (keep open till numpydev is fixed)

Labels:
name: CI
description: Continuous Integration
name: Dependencies
description: Required and optional dependencies

Comments:
pending green, lgtm
It's failing in many places now. I suspect numpy will revert this change, but I'm tracking that in https://github.com/numpy/numpy/pull/14800.

For now, we'll ignore failures on numpydev.
trailing whitespace
REF: separate out ShallowMixin
State: closed

- [x] closes #28938
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`

Stops catching DataError in the 1D case for _aggregate_multiple_funcs.  This change is mostly unrelated, but shares the process of reasoning about what cases need _shallow_copy/DataError.

Labels:
name: Refactor
description: Internal refactoring of code
name: Internals
description: Related to non-user accessible pandas implementation

Comments:
thanks @jbrockmendel
BUG: fix TypeErrors raised within _python_agg_general
State: closed

cc @jreback @WillAyd 

There are a few ways in which we incorrectly raise TypeError within _python_agg_general that this fixes.

A lot of the complexity in this code comes from the fact that we drop columns on which a function is invalid instead of requiring the user to subset columns.

Labels:
name: Groupby
name: Error Reporting
description: Incorrect or improved errors from pandas
name: Internals
description: Related to non-user accessible pandas implementation

Comments:
This does conflict with #29124 - wonder if that would have any material impact on exception catching here (maybe, maybe not)
TST: consistent result in dropping NA from CSV
State: closed

Closes https://github.com/pandas-dev/pandas/issues/21131

Labels:
name: Testing
description: pandas testing functions or related to the test suite
name: Missing-data
description: np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate
name: IO CSV
description: read_csv, to_csv

Comments:
<strike>@pandas-dev/pandas-core :

https://dev.azure.com/pandas-dev/pandas/_build/results?buildId=20243

Any ideas as to why this would be failing consistently?  `master` (d5699051) is okay, and this branch is based off `master`, and I don't think this commit is the cause for the issue.</strike>

Being tracked and handled in https://github.com/pandas-dev/pandas/issues/29432
thanks @gfyoung
Correct type inference for UInt64Index during access
State: closed

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


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

Comments:
Thanks for the PR!
Test failures related to https://github.com/pandas-dev/pandas/issues/29432
Hello @oguzhanogreden! Thanks for updating this PR. We checked the lines you've touched for [PEP 8](https://www.python.org/dev/peps/pep-0008) issues, and found:





There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers: 

##### Comment last updated at 2019-11-23 15:22:46 UTC
This will fail due to #29526.
Between two laptops and a rebase, git happened again. Sorry for the spam!
@jschendel [here](https://github.com/pandas-dev/pandas/pull/29529#pullrequestreview-314688566) you suggested that the What's New entry goes under `Numeric`. It's not clear to me why these are not under `Indexing`. Can you confirm that this is where the last 4 entries do belong?
The "Indexing" section is generally for operations that have to do with selecting data with an index, e.g. `loc`/`iloc`, and the associated index methods that support this, e.g. `get_loc`/`get_indexer`. For example, see the types of things tested in `pandas/tests/indexing`.  The "Numeric" section deals more with issues related to numeric operations, e.g. computation, precision, inference, etc.
thanks for the patch @oguzhanogreden
CLN: assorted, mostly typing
State: closed

diff_2d no longer needs to be in the pxi.in file, so moved it to the pyx

A couple of recently-identified bugs in the groupby code are caused by passing incorrect types, so im getting more motivated to add annotations in/around the affected code.

Labels:
name: Internals
description: Related to non-user accessible pandas implementation
name: Clean

Comments:
> but I also feel that this PR covers a little too much ground and could have benefited from being broken up into smaller parts (e.g. typing, Cython refactoring

Totally reasonable.  If others find this a deal-breaker I'll split this up.  Otherwise I'll apply this advice in future CLN PRs
this is ok, but generally yes would like to split largish changes. note to @WillAyd this might conflict with your groupby PR?
maybe_promote: Restrict fill_value to scalar for non-object dtype
State: closed

Partially reverts #29362 by allowing non-scalar fill_value for _object_ dtypes.  i.e. in 0.25.3 `pd.Series(range(3), dtype=object).shift(1, fill_value={})` would work, #29362 broke that, and this restores it.  Added `test_shift_object_non_scalar_fill` for this.

With the new restriction on `maybe_promote` in place, we can get rid of all the `box` tests and simplify test_promote a _ton_.  This removes about 2500 tests.  This also uncovers the fact that we were failing to run some of the non-box cases, which are now xfailed.

Labels:
name: Dtype Conversions
description: Unexpected or buggy dtype conversions
name: Internals
description: Related to non-user accessible pandas implementation
name: Clean

Comments:
thanks ! very nice
Fixed SS03 errors
State: closed

Fixed SS03 errors for:
`pandas.Timestamp.combine`; `pandas.Timestamp.fromordinal`; `pandas.Period.strftime`; `pandas.Interval.closed`; `pandas.Interval.left`; `pandas.Interval.length`; `pandas.Interval.mid`; `pandas.Interval.right`.

- [x] xref to #29315
- [ ] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry

Similar to #28053 I could not find methods for `pandas.Timestamp.isoweekday` or `pandas.Timestamp.weekday`. This was not resolved in #28053. I think this may be due to docstrings in the original python datetime file.
Timestamp import _Timestamp which imports datetime. Neither Timestamp nor _Timestamp have `isoweekday` or `weekday` methods.
@datapythonista 

Labels:
name: Docs

Comments:
Thanks @SebStrug
API: rename labels to codes in core/groupby
State: closed

This PR renames the various ``*label*`` names in core/groupby to like-named ``*codes*``.

I think the name ``label`` can be confused by the single values in a index, and ``codes`` sound smore like an array of ints, so by renaming we get a cleaner nomenclature, IMO.

All these attributes/methods are internal, so no deprecations needed.

Labels:
name: Groupby
name: API Design

Comments:
@WillAyd, Thanks. There are a few places where they actually are labels, and I even found one place where it started out as "real" labels and later changed into codes, while still being called labels...not easy to keep track of.

I thinkt we should try to get the label names that actually are code arrays to be renamed to codes. For example in ``pd.factorize`` the labels name is still used.
Is this ok to take in, @WillAyd ?
looks good. can you merge master and ping on green (we just pushed some groupby changes).
PR09 Batch 2
State: closed

Another batch of commits for #28602. Also fixes a few summary formatting errors and PR08 capitalization errors. 

Labels:
name: Docs

Comments:
Hello @HughKelley! Thanks for updating this PR. We checked the lines you've touched for [PEP 8](https://www.python.org/dev/peps/pep-0008) issues, and found:













There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers: 

##### Comment last updated at 2019-11-04 15:00:21 UTC
Thanks @HughKelley
BUG: GH25495 incorrect dtype when using .loc to set Categorical value for column in 1-row DataFrame
State: closed

- [x] closes https://github.com/pandas-dev/pandas/issues/25495
- [x] 1 test added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`



Labels:
name: Bug
name: Indexing
description: Related to indexing on series/frames, not to indexes themselves
name: Categorical
description: Categorical Data Type

Comments:
> lgtm. can you add a whatsnew note in bug fixes / indexing section. ping on green.

Thanks @jreback. Added a whatsnew note. 
Hello @keechongtan! Thanks for updating this PR. We checked the lines you've touched for [PEP 8](https://www.python.org/dev/peps/pep-0008) issues, and found:





There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers: 

##### Comment last updated at 2020-01-27 11:52:36 UTC
> lgtm. can you merge master & ping on green.

@jreback, merged master and all tests passed
if you can merge master and update would be great
@keechongtan if you'd rebase once more we can merge.
ping when green.
thanks @keechongtan 

happy to have a followup as discussed (pls create an issue)
@jreback seems like this wasn't backported.

@MeeseeksDev backport 1.0.x
TST: Test DataFrame.rolling with window as string
State: closed

Closes https://github.com/pandas-dev/pandas/issues/22590

Labels:
name: Testing
description: pandas testing functions or related to the test suite
name: Windows
description: Windows OS
name: Window
description: rolling, ewma, expanding

Comments:
lgtm ping on green.
@jreback : Ping
Thanks @gfyoung
Fix: DataFrame.append with empty list raises IndexError
State: closed

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


Labels:

Comments:
Didn't see there's already a PR for that 🤦‍♂ Closing...
CLN core.groupby
State: closed

Broken off from local branches doing non-CLN work.

Foreshadowing: some of the TypeErrors we are catching are being caused by `self.axis` not being an Index instead of an int in some cases.

Labels:
name: Internals
description: Related to non-user accessible pandas implementation
name: Clean

Comments:
Hello @jbrockmendel! Thanks for updating this PR. We checked the lines you've touched for [PEP 8](https://www.python.org/dev/peps/pep-0008) issues, and found:













There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers: 

##### Comment last updated at 2019-11-03 22:20:33 UTC
thanks!
REF: move safe_sort to algos to avoid private/circular dependencies
State: closed

safe_sort uses private functions from core.algorithms and is runtime-imported into core.algorithms.  It also doesn't use _anything_ else defined in core.sorting.  This move cleans up the dependency structure, in particular is a step towards getting #29133 working.

Labels:
name: Clean

Comments:
rather than adding to algos i would put in a separate module
maybe let’s create

pandas/corr/algos/sorting.py, safe_sort.py, algos.py


> pandas/corr/algos

I think we're going to get there before long, yah.  There are a few parts of algorithms.py that are inextricably intertwined with Series, but a bunch of it can be made low-dependency with a few tweaks.  One of those tweaks is going to be inside safe_sort, which still has a runtime import of Index which I plan to address in the next step.  After that is when I was thinking of making core/algos/ a directory
right but rather than moving it twice wouldn’t make sense to move to safe_sort.py now?
either way i guess.  making a new directory and moving a bunch of stuff into it entails updating a lot of other imports
since this is a moving PR, I think doing it here is better (e.g. just move this for now to pandas/core/algos/safe_sort.py), then changing other things can be a follow on
> since this is a moving PR, I think doing it here is bette

last effort to push back before i go along with this: `safe_sort` uses _private_ functions from algorithms.py, moving just safe_sort without carefully handling the rest of the module doesn't improve things on that front
> > since this is a moving PR, I think doing it here is bette
> 
> last effort to push back before i go along with this: `safe_sort` uses _private_ functions from algorithms.py, moving just safe_sort without carefully handling the rest of the module doesn't improve things on that front

ok fine..... but would love the refactor - ok on doing as followons
TST: new test for incorrect series assignment
State: closed

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


Labels:
name: Testing
description: pandas testing functions or related to the test suite
name: Indexing
description: Related to indexing on series/frames, not to indexes themselves

Comments:
Thanks @ganevgv!
CLN: deprivatize factorize_from_iterable
State: closed

Deprivatize ``_factorize_from_iterable`` and ``_factorize_from_iterables``

Labels:
name: Clean

Comments:
pending green, lgtm
What is the goal of this?
> What is the goal of this?

rule of thumb: respect private naming conventions
> What is the goal of this?

This isn't private any more than anything else in ``pd.core``, so just remove the private marker.
lgtm. merge master and merge on green.
TST: new test for sort index when Nan in other axis.
State: closed

closes #12261 
test added / passed
passes black pandas

Labels:
name: Reshaping
description: Concat, Merge/Join, Stack/Unstack, Explode
name: MultiIndex

Comments:
Hello @ainsleyto! Thanks for opening this PR. We checked the lines you've touched for [PEP 8](https://www.python.org/dev/peps/pep-0008) issues, and found:

* In the file [`pandas/tests/frame/test_sorting.py`](https://github.com/pandas-dev/pandas/blob/a244e7591ef01c06cbf02a1fa260cca20d39d754/pandas/tests/frame/test_sorting.py):

> [Line 746:42](https://github.com/pandas-dev/pandas/blob/a244e7591ef01c06cbf02a1fa260cca20d39d754/pandas/tests/frame/test_sorting.py#L746): [E712](https://duckduckgo.com/?q=pep8%20E712) comparison to True should be 'if cond is True:' or 'if cond:'


@ainsleyto needs rebase, also see the linting complaint above
@ainsleyto can you fix the conflict and address feedback?
closing as stale, ping if you want to continue
TST: new test for str to small float conversion dtype
State: closed

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


Labels:
name: Testing
description: pandas testing functions or related to the test suite
name: Numeric Operations
description: Arithmetic, Comparison, and Logical operations

Comments:
lgtm pending @mroeschke comment
Thanks @ganevgv!
TST: Adding merge test for non-string columns [Ref 17962]
State: closed

- [x] closes #17962
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`


Labels:
name: Testing
description: pandas testing functions or related to the test suite
name: Reshaping
description: Concat, Merge/Join, Stack/Unstack, Explode

Comments:
lgtm, pending @mroeschke comment
Thanks @sofiane87!
GH:11670: possible bug when calculating mean of DataFrame?
State: closed

- [x] closes #11670
- [x] tests added / passed
- [x] passes `black pandas`
- [x] added test test_mean_mixed_string_float

Labels:
name: Testing
description: pandas testing functions or related to the test suite
name: Numeric Operations
description: Arithmetic, Comparison, and Logical operations

Comments:
thanks @pv8473h12
Fix pipe docs
State: closed

- [x] closes #27054

See the image below which highlights what i've done here

![image](https://user-images.githubusercontent.com/16733618/68074732-4f5e1b80-fd96-11e9-96ea-d2f40e07ee3e.png)

`flake8-rst doc/source --filename=/getting_started/basics.rst` runs clean

cc. @datapythonista to review

Labels:
name: Docs

Comments:
Unsure why the code coverage has dramatically reduced..
Thanks for the comments @WillAyd totally agree - updated
Thanks @alimcmaster1 
Thanks @WillAyd 
Sorry I couldn't check this before. Looks great, good job @alimcmaster1. Happy to see this finally improved.
TST: Adding map test for dict with np.nan key [Ref 17648]
State: closed

- [x] closes #17648
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`


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

Comments:
Thanks @sofiane87