BrandonFors/pandas-github-issues huggingface dataset:
DOC: use black to fix code style in doc pandas-dev#36777
State: closed

Partially addresses #36777. Ran black on all the files under `doc/source/getting_started/comparison`.

Labels:
name: Docs

Comments:
Actually may have approved too quickly, looks like there are some linting errors
Seems like the latest commit fixed all the linting errors. Please have a look again.
Sorry to bother again, but does this PR now count towards Hacktoberfest? It shows that it is under review but we know that it has been already reviewed and accepted. Do you need to add the `hacktoberfest-accepted` label? 

Source:
![image](https://user-images.githubusercontent.com/44412790/94981903-ae528480-0553-11eb-9e72-9a30d4c538f2.png)

@PrayagS I'm not too familiar with how Hacktoberfest works, but I think you should be good since the PR was merged. As far as I can tell the Hacktoberfest label is optional (we don't have one).
So sorry to disturb again but Hacktoberfest has undergone some changes due to the excessive spamming that occurred this year. The rules for a PR to be accepted have been modified. You can read about it here: https://hacktoberfest.digitalocean.com/hacktoberfest-update

Here is the most important part for maintainers:

![image](https://user-images.githubusercontent.com/44412790/94985906-ef5c9000-0577-11eb-9eaa-850fcd0b0942.png)

I can completely understand if pandas as an org doesn't do this but just notifying in case. 

@PrayagS Ah, looks like we probably do need to add the hacktoberfest topic. Can you create an issue about that?
@dsaxton Done. #36837
CLN: test_moments_consistency_*.py
State: closed

- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`


In-lining some common functions to make it easier to follow test failure tracebacks

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

Comments:
thanks!
TST: insert 'match' to bare pytest raises in pandas/tests/indexing/te…
State: closed

…st_indexing.py

- [ ] ref https://github.com/pandas-dev/pandas/issues/30999
- [ ] tests added / passed
- [ ] passes `black pandas`
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry


Labels:

Comments:
thanks @krajatcl
Fix select_dtypes(include='int') for Windows.
State: closed

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


Labels:
name: Dtype Conversions
description: Unexpected or buggy dtype conversions
name: Windows
description: Windows OS

Comments:
This pull request is stale because it has been open for thirty days with no activity. Please update or respond to this comment if you're still interested in working on this.
@jreback 
What I see as possible changes to `.select_dtypes`:

1. Treat _int_ both as _np.int32_ and _np.int64_. If we have columns with both 64- and 32-bit integers we'll keep all of them
     I implemented this behavior in the current version, so now [this example](https://github.com/pandas-dev/pandas/issues/36596#issue-708024686) and [this exaple](https://github.com/pandas-dev/pandas/pull/36808#discussion_r498951543) should both work
2. Map _int_ to either _np.int32_ or _np.int64_ depending on the type of the given dataframe (_np.int32_, _np.int64_)
3. Raise a warning / error that _int_ is ambiguous, and either _np.int32_ or _np.int64_ should be provided

Another possible routes:
1. Change [maybe_convert_objects](https://github.com/pandas-dev/pandas/blob/d3788525ee368db0b6565b72ab4eeba9140fd1d4/pandas/_libs/lib.pyx#L2115) so it would follow [numpy's behavior](https://github.com/numpy/numpy/issues/9464)
2. Map_int_ to _np.int64_ all the time, as was done previously in this pull request
@arw2019 I merged this branch to the latest master.
@jbrockmendel  I added a separate unit test.
@jreback As you [suggested](https://github.com/pandas-dev/pandas/pull/36808#discussion_r519529870), I moved code from [pandas_dtype](https://github.com/pandas-dev/pandas/blob/4b75067f4f5b01744a9565a21d5ac5057c6a7c43/pandas/core/dtypes/common.py#L1799) into [DataFrame.select_dtypes](https://github.com/pandas-dev/pandas/blob/9769b9dbab018bb192b8776d2db40402b27c388c/pandas/core/frame.py#L3626). In detail, this method will treat _int_ both as _np.int32_ and _np.int64_. Having columns with both 64- and 32-bit integers it will return all of them.
     I implemented this behavior in the current version, so now [this example](https://github.com/pandas-dev/pandas/issues/36596#issue-708024686) and [that exaple](https://github.com/pandas-dev/pandas/pull/36808#discussion_r498951543) should both work.
@jreback I have updated this pull request according to your latest review. Could you take a look at it again?
thanks @OlehKSS very nice!
DOC: ran blacken docs tool and checked output to improve formatting #36777
State: closed

For task #36777
Ran blacken-tools on user_guide/10min.rst, user_guide/advanced.rst, basics.rst


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

Comments:
Thanks @maria-ilie ! This looks correct, it's just that E203 needs to be added to the ignore list for [flake8-rst]

Could you make the following change to `setup.cfg` as well? I think it's fine if it's part of this same pull request

```diff
diff --git a/setup.cfg b/setup.cfg
index 73986f692..eb2efb937 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -40,7 +40,9 @@ bootstrap =
     np  # avoiding error when importing again numpy or pandas
     pd  # (in some cases we want to do it to show users)
 ignore = E402,  # module level import not at top of file
+         E203,  # space before : (needed for how black formats slicing)
          W503,  # line break before binary operator
+         W504,  # line break after binary operator
          # Classes/functions in different blocks can generate those errors
          E302,  # expected 2 blank lines, found 0
          E305,  # expected 2 blank lines after class or function definition, found 0
```

(please do ask if you want/need help)
Just to be sure we don't get any conflicts, I edited `10min.rst` on #36780 
Thanks @maria-ilie for the PR, can you merge master to fix the conflict?
Thanks @maria-ilie 
Thanks so much for reviewing! 
Happy to help, let us know if you'd like any help/mentoring with other issues
CLN: Use more pytest idioms in test_momemts_ewm.py
State: closed

- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`

Use `pytest.mark.parameterize` and unnest helper test functions

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

Comments:
thanks @mroeschke follows welcome (per @simonjayhawkins comments)
BUG: Fix FloatingArray output formatting
State: closed

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


Labels:
name: Output-Formatting
description: __repr__ of pandas objects, to_string
name: NA - MaskedArrays
description: Related to pd.NA and nullable extension arrays

Comments:
thanks @dsaxton 
Thanks @dsaxton !
DEPR: automatic alignment on frame.__cmp__(series)
State: closed

- [ ] closes #xxxx
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry

xref #28759, may close it depending on if we want to do anything else on that front

Labels:
name: Reshaping
description: Concat, Merge/Join, Stack/Unstack, Explode
name: Deprecate
description: Functionality to remove in pandas

Comments:
rebased+green
API: make DataFrame.__boolop__ default_axis match DataFrame.__arithop__ default_axis
State: closed

- [x] closes #36788
- [ ] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry

Fix a test warning generated by an ipython test, unrelated

Labels:
name: Reshaping
description: Concat, Merge/Join, Stack/Unstack, Explode
name: API - Consistency
description: Internal Consistency of API/Behavior

Comments:
see fine, as to your original question i don't think we want the special case
BUG: GroupBy.ffill()/bfill() do not return NaN values for NaN groups
State: closed

- [x] closes #34725
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry

See #34725 for a good description of the problem. 

This fixes the issue in the tidiest way I could find. 

One test is added that covers all relevant cases I could think of. The comments in the test can be removed, they are just there to make it easier for the reviewer to follow as the test is a bit complicated. 

This also fixes the copy-pastable example from the #34725.

Labels:
name: Bug
name: Groupby
name: Missing-data
description: np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate

Comments:
Is there a way to fix `group_fillna_indexer` rather than correct the results with post-processing? Or is there a reason _not_ to do this?
> Is there a way to fix `group_fillna_indexer` rather than correct the results with post-processing? Or is there a reason _not_ to do this?

@rhshadrach This is fixed in `group_fillna_indexer` now. It is much cleaner and faster. 
@rhshadrach @WillAyd  Comments have been addressed. Can you please have another look?
> Looks good. Can you move tests to tests.groupby.test_missing - ref #36326

@rhshadrach Done. 
@smithto1 CI failure due to import order in unrelated files; I think merging master will fix.
> @smithto1 CI failure due to import order in unrelated files; I think merging master will fix.

@rhshadrach I think that is all fixed now. 
@smithto1 Got a new conflict that needs resolved.
thanks @smithto1
TST: Add test for 32724
State: closed

- [x] closes #32724 
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`


Was fixed in the past.

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

Comments:
/azp run
<samp>
Azure Pipelines successfully started running 1 pipeline(s).<br>

</samp>
Thanks @phofl
BUG: Rolling returned nan with FixedForwardWindowIndexer for count when window contained only missing values
State: closed

- [x] closes #35579
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry

Issue still has milestone 1.1.3. If it's to late for this release, I'll move the whats new note to 1.1.4 for when the associated PR is merged.

cc @mroeschke 

Labels:
name: Window
description: rolling, ewma, expanding

Comments:
Have just seen #36649 which will close the issue.
CLN: Remove param _set_identity from MultiIndex
State: closed

I don't see how `_set_identity`can be needed and other index classes don'r have this parameter, so best to just remove it.

Other index classes always end by calling `_reset_identity`, so I just do that here also. I'm not sure that's really needed, but that's for another day.

Labels:
name: MultiIndex
name: Clean

Comments:
LGTM pending green, agreed this is weird
yeah this is fine, I remember adding this at some point, then we removed but i guess not fully.
CLN: test_moments_rolling.py for quantile/kurt/skew
State: closed

- [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: Clean
name: Window
description: rolling, ewma, expanding

Comments:
thanks!
Test that nan value counts are included when dropna=False. GH#31944
State: closed

- [x] closes #31944
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry

Added test per @Dr-Irv request.


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

Comments:
Hi y'all, any other changes for this pull request?
thanks @icanhazcodeplz
DOC: Fix code style in documentation
State: closed

ref #36777 


Labels:

Comments:
Hello @erfannariman! 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 [`test.py`](https://github.com/pandas-dev/pandas/blob/2976283611fc711c2452612d8fd45225cf7a308d/test.py):

> [Line 3:3](https://github.com/pandas-dev/pandas/blob/2976283611fc711c2452612d8fd45225cf7a308d/test.py#L3): [W292](https://duckduckgo.com/?q=pep8%20W292) no newline at end of file


@dsaxton the changes I made now are all done with black itself. 
Thanks @erfannariman!
CI: troubleshoot UnsatisfiableError in travis-36-cov on 1.1.x
State: closed

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


Labels:
name: CI
description: Continuous Integration

Comments:
@TomAugspurger the coverage job on travis first timed-out here https://travis-ci.org/github/pandas-dev/pandas/builds/728369353

I can replicate with just nomkl, scikit-learn and numpy[1]. 

AFAICT the versions of these have not changed since the last good build. Any ideas?

output from local below. running here to see if same.

```
UnsatisfiableError: The following specifications were found to be incompatible with each other:

Output in format: Requested package -> Available versions

Package setuptools conflicts for:
scikit-learn -> joblib[version='>=0.11'] -> setuptools
python=3.6 -> pip -> setuptools

Package numpy conflicts for:
scikit-learn -> numpy[version='>=1.11.3,<2.0a0|>=1.14.6,<2.0a0|>=1.16.5,<2.0a0']
numpy=1.15
scikit-learn -> scipy -> numpy[version='>=1.15.1,<2.0a0']

Package python conflicts for:
python=3.6
scikit-learn -> python[version='>=2.7,<2.8.0a0|>=3.6,<3.7.0a0|>=3.8,<3.9.0a0|>=3.7,<3.8.0a0|>=3.5,<3.6.0a0']
scikit-learn -> joblib[version='>=0.11'] -> python[version='2.7.*|3.5.*|3.6.*|>=3.6|3.8.*|>=3.5|3.7.*']
```

[1] Updated: building the environment will also fail if excluding numpy. but we want that pinned.
closing, not getting same error as local here.
ENH: Implement FloatingArray reductions
State: closed

Mostly copy / paste from https://github.com/pandas-dev/pandas/pull/36761

@jorisvandenbossche Would this require a whatsnew note? Seems the current v1.2.0 note is fairly high level and doesn't talk about specific methods that are supported. Should we talk about this or leave as-is?

Labels:
name: Enhancement
name: NA - MaskedArrays
description: Related to pd.NA and nullable extension arrays

Comments:
actually if you rebase I think you can push these down to BaseMaskedArray entirely (or factor out to NumericMaskedArray if need to avoid the bool collision issues)
great ping on green.
thanks
DOC: Fix code block line length
State: closed

https://github.com/pandas-dev/pandas/pull/36734#discussion_r498058234

Labels:
name: Docs

Comments:
How are you running this, with https://github.com/asottile/blacken-docs ? If so, should it be added as an extra hook?
> How are you running this, with https://github.com/asottile/blacken-docs ? If so, should it be added as an extra hook?

This part I did manually, but yeah I've used blacken-docs for a lot of this cleanup. I don't think we'd be able to add it as a hook yet because it raises tons of errors at the moment due to unparsable code blocks (e.g., raw output and magic commands, https://github.com/pandas-dev/pandas/pull/36734#issue-495192980).

If we want to do this in general I think it probably warrants some kind of issue to encourage contributions from others as there's a lot of "manual labor" involved.
So IIUC we are changing this because it doesn't fit in the web page? Can we not edit the web page to better accommodate rather than changing this though? I think should keep consistent between our docs and internal code base
> So IIUC we are changing this because it doesn't fit in the web page? Can we not edit the web page to better accommodate rather than changing this though? I think should keep consistent between our docs and internal code base

Would changing the site be hard (I wouldn't know how to do that)? In general I think @jorisvandenbossche point makes sense of preferring not having to scroll over strict adherence to all internal style guidelines. I think the main thing is avoiding the older line-wrapping behavior which makes the docs harder to read IMO.
I guess I don't really understand how setting this to 84 instead of 88 should impact the scrolling universally. Word wrapping should be controlled by the styling of the site, no?
> I guess I don't really understand how setting this to 84 instead of 88 should impact the scrolling universally. Word wrapping should be controlled by the styling of the site, no?

Code blocks don't get automatic word wrapping in html (as I think it should be?), as opposed to normal flowing text. 

So on my screen and with the current dev docs (this might of course depend on laptop, browser, OS, ..), the code blocks on a normal doc page have a width that fits 94 characters (eg here is an overflow (because of bad repr of categorical/interval index): https://pandas.pydata.org/docs/dev/user_guide/basics.html#discretization-and-quantiling, so you can check how many characters fit on screen). 
Taking into account that the `In [..]: ` also still take around 10 characters, that's why I proposed 84 (but again, this will depend on other factors, so maybe keeping at 79 is actually safest for now).


It's certainly possible to change the width of site (although there are also reasons to not make it too wide, like readability), but that's something we should then change *first*, IMO, as a user should simply never see hidden input code in the examples.

thanks @dsaxton
Update README.md
State: closed

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


Labels:

Comments:
If you think it's important that this change be made, use semi-colons, not full stops

> For a list of longer items or sentences, which follow on from an introductory sentence, each item should end with a semi colon and the final item should end with a full stop.

https://www.imperial.ac.uk/brand-style-guide/writing/grammar/punctuation/bullet-points/
/azp skip
<samp>
Command 'skip' is not supported by Azure Pipelines.<br>
<br>
<b>Supported commands</b><br>
<ul type="none"><li><b>help:</b></li><ul type="none"><li>Get descriptions, examples and documentation about supported commands</li><li><b>Example: </b>help "command_name"</li></ul><li><b>list:</b></li><ul type="none"><li>List all pipelines for this repository using a comment.</li><li><b>Example: </b>"list"</li></ul><li><b>run:</b></li><ul type="none"><li>Run all pipelines or specific pipelines for this repository using a comment. Use this command by itself to trigger all related pipelines, or specify specific pipelines to run.</li><li><b>Example: </b>"run" or "run pipeline_name, pipeline_name, pipeline_name"</li></ul><li><b>where:</b></li><ul type="none"><li>Report back the Azure DevOps orgs that are related to this repository and org</li><li><b>Example: </b>"where"</li></ul></ul><br>
See <a href="https://go.microsoft.com/fwlink/?linkid=2056279">additional documentation.</a>
</samp>
thanks
you're welcome.
BUG: Timedelta drops decimals if precision is greater than nanoseconds
State: closed

- [x] closes #36738
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry

I am not quite sure, if we should round to nanoseconds or cut if off after the 9th decimal. I implemented a simple cut off, but would be happy to change if rounding is better.

I would also add a note to the user guide if the future behavior is clear

Labels:
name: Timedelta
description: Timedelta data type

Comments:
/azp run
<samp>
Commenter does not have sufficient privileges for PR 36771 in repo pandas-dev/pandas<br>

</samp>
Failure seems weird, maybe rerunning the pipeline?
I think truncation is reasonable. I think it would be good to document this behavior in `Timedelta` and `to_timedelta`.

Could you also add a test that goes through `to_timedelta`?
The test ran through ``to_timedelta`` but not through ``Timedelta``. Added this one. Also added a note to the docstrings
Failure unrelated
This pull request is stale because it has been open for thirty days with no activity. Please update or respond to this comment if you're still interested in working on this.
Mind merge master @phofl? This LGTM after that 
@mroeschke done
ci failure is from master and will be fixed with #37756
@phofl I merged that PR, so you can update here as well now
Thanks, done
thanks @phofl
CI: troubleshoot travis ci on 1.1.x
State: closed

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


Labels:
name: CI
description: Continuous Integration

Comments:
this fixes travis-36-locale so merging soon if no objections
BUG: Index sortlevel ascending add type checking #32334
State: closed

- [x] closes #32334
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry

Add the check of ascending parameter in the sortlevel method, only allow bool value and single bool value list

cc @Dr-Irv 


Labels:
name: Typing
description: type annotations, mypy/pyright type checking

Comments:
> Looks good. Can you add a `whatsnew` entry for v1.2 ?

I have added the v1.2 whatsnew entry , please take a look
thanks @BeanNan
BUG: fix inconsistent col spacing in info
State: closed

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


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

Comments:
It is dependent, but the problem was that the width of the string with the column number is the actual width of the number + 1 space (Line 342 of the original file shows that line number string is prepended with a space). This PR fixes the problem and makes consistent spacing even when the number of columns is over 1000.
DOC: Fix PR09 errors in several files
State: closed

- [x] closes #36764
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry

As far as I can see, there are some PR09 pandas docstring errors. So with this PR I will resolve them. There are more commits soon.
```
PR09
Parameter description should finish with "."
```

Labels:
name: Docs

Comments:
Thanks @Iqrar99 
You are welcome! Happy to help.
TST: insert 'match' to bare pytest raises in pandas/tests/indexing/te…
State: closed

…st_chaining_and_caching.py

- [ ] ref https://github.com/pandas-dev/pandas/issues/30999
- [ ] tests added / passed
- [ ] passes `black pandas`
- [ ] 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:
Thanks @krajatcl