BrandonFors/pandas-github-issues huggingface dataset:
BUG: extra row created when calling to_excel for multi-index columns
State: closed

- [ ] closes #xxxx (Replace xxxx with the Github issue number)
- [x] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.



When multi-level columns are written into excel, use to_ Excel method, there will be an extra row in the saved xlsx file

![image](https://user-images.githubusercontent.com/20391209/165278268-c8319b4f-572b-4b37-8ba8-f0ed4318f053.png)

I tried to fix and welcome to comment for this update.




Labels:
name: IO Excel
description: read_excel, to_excel
name: Stale

Comments:
what happens when the index has a name, i.e. it creates an `index_label` in the code. I suspect this will fail and it will break tests?
Thanks for the PR. It looks like this broke existing tests - can you add a test for the functionality you are proposing and make sure the existing ones are still working? 
> 

OK. I will do that. Then pull request again here.
This pull request is stale because it has been open for thirty days with no activity. Please [update](https://pandas.pydata.org/pandas-docs/stable/development/contributing.html#updating-your-pull-request) and respond to this comment if you're still interested in working on this.
Thanks for the pull request, but it appears to have gone stale. If interested in continuing, please merge in the main branch, address any review comments and/or failing tests, and we can reopen.
BUG: Raise error when expr does not evaluate to bool in df.query 
State: closed

- [X] closes  #8560
- [X] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [X] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [X] Added an entry in the latest `doc/source/whatsnew/v1.5.0.rst` file if fixing a bug or adding a new feature.


Labels:
name: Bug
name: expressions
description: pd.eval, query
name: Stale

Comments:
Special attention to line 4139 in
https://github.com/pandas-dev/pandas/blob/b8e1aa44771a60899bc57fc8e12ba367088e23e4/pandas/core/frame.py#L4137-L4141

This condition was added in order to pass some special test that used higher dimensions. These tests were

pandas/tests/frame/test_query_eval.py::TestDataFrameQueryNumExprPandas::test_nested_scope
pandas/tests/frame/test_query_eval.py::TestDataFrameQueryPythonPandas::test_nested_scope

This is because these tests produce a  res that evaluates to false in first condition (line 4137)
```python
res =        0      1      2
0   True  False  False
1  False  False  False
2  False  False   True
3   True   True  False
4  False   True   True
```
So in this case we check for column to be bool type



Sorry for the long delay, I had a couple of hard weeks. But now on I can and will iterate a lot quicker.
This pull request is stale because it has been open for thirty days with no activity. Please [update](https://pandas.pydata.org/pandas-docs/stable/development/contributing.html#updating-your-pull-request) and respond to this comment if you're still interested in working on this.
Thanks for the pull request, but it appears to have gone stale. If interested in continuing, please merge in the main branch, address any review comments and/or failing tests, and we can reopen.
CLN: assorted cleanups in cython
State: closed

- [ ] closes #xxxx (Replace xxxx with the Github issue number)
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.


Labels:
name: Clean

Comments:
Thanks @jbrockmendel
BUG: Series.map is ignoring the na_action keyword
State: closed

- [x] closes #46588 
- [x] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [x] Added an entry in the latest doc/source/whatsnew/v1.5.0.rst file if fixing a bug or adding a new feature.

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

Comments:
Hello @stanleycai95! 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 2022-04-26 01:48:01 UTC
Added documentation updates + test. Thank you for the feedback!!
thanks @stanleycai95 very nice!
Update join docs for other param
State: closed

Currently the `DataFrame.join` docs imply that the type of `other` is `DataFrame | Series | list[DataFrame]`, but this is not correct, and `list[Series | DataFrame]` is a more appropriate type. 

The type signature and also the method description have been updated to amend this.

- [ ] closes #xxxx (Replace xxxx with the Github issue number)
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.


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

Comments:
No idea why this is failing 🤷
This pull request is stale because it has been open for thirty days with no activity. Please [update](https://pandas.pydata.org/pandas-docs/stable/development/contributing.html#updating-your-pull-request) and respond to this comment if you're still interested in working on this.
@multimeric - are you interested in continuing this?
Hmm, I'm a bit stuck. I can't work out how to get mypy to understand it's working with a list of `Series | DataFrame`.
`pandas/core/frame.py:9586: error: Argument 1 to "list" has incompatible type "Union[DataFrame, Series, Iterable[Union[DataFrame, Series]]]"; expected "Iterable[DataFrame]"  [arg-type]`
It's not clear to me what type signature is causing this to fail. Even if I type cast it I'm still getting the same error.
I think the line should be:

    frames = [cast("DataFrame | Series", self)] + list(cast("Iterable[DataFrame | Series]", other))

 - You need quotes because otherwise the Python tries to actually use the `|` operator. In other words, the first argument of `cast` needs to be a valid Python object.
 - You need to cast `[self]` as well; mypy will object to combining lists of different types.
Thanks, that fixed it. Indeed I didn't try casting both parts of the concatenation, partly because I would have thought mypy could have narrowed the type of `self` at that point to `other` to `Iterable` because of the if statements. Ah well!
@multimeric can you merge master into your branch, seems like the problem in the CI is unrelated.
I actually did that just before. It looks like the current failure is just a timeout? Happy to pull again though.
No, there is indeed a failure here. But it seems unrelated entirely.
This pull request is stale because it has been open for thirty days with no activity. Please [update](https://pandas.pydata.org/pandas-docs/stable/development/contributing.html#updating-your-pull-request) and respond to this comment if you're still interested in working on this.
@multimeric do you have time to add the requested comment? And ir'd also be good if you can merge master into your branch

@rhshadrach I think  your comments were addressed, can you check if this is ready from your side?
Thanks @multimeric for your persistence and all for the review!
BUG: fix subset parameter of DataFrameGroupBy.value_counts has no effect #46383
State: closed

- [ ] closes #xxxx (Replace xxxx with the Github issue number)
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.


Labels:

Comments:
Hello @zhenqin77! 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/core/groupby/generic.py`](https://github.com/pandas-dev/pandas/blob/e350e35d41de4e5fb63429973bacfcc050698d8f/pandas/core/groupby/generic.py):

> [Line 1749:1](https://github.com/pandas-dev/pandas/blob/e350e35d41de4e5fb63429973bacfcc050698d8f/pandas/core/groupby/generic.py#L1749): [W293](https://duckduckgo.com/?q=pep8%20W293) blank line contains whitespace
CI/TST: xfail git test failure on 32 bit job
State: closed

- [x] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).

Doesn't appear that a specific commit changed this recently, so xfailing for now.


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

Comments:
strict=False?  i dont think its failing on all builds, e.g. #46839
> strict=False? i dont think its failing on all builds, e.g. https://github.com/pandas-dev/pandas/pull/46839

Looks like Azure didn't run which has the 32 bit build
somehow the xfail condition is evaluating to False?
LGTM
@meeseeksdev backport 1.4.x
Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

1. Checkout backport branch and update it.

```
git checkout 1.4.x
git pull
```

2. Cherry pick the first parent branch of the this PR on top of the older branch:
```
git cherry-pick -x -m1 976404bde733c4751da56b41fba0aa95b4c8165d
```

3. You will likely have some merge/cherry-pick conflict here, fix them and commit:

```
git commit -am 'Backport PR #46842: CI/TST: xfail git test failure on 32 bit job'
```

4. Push to a named branch:

```
git push YOURFORK 1.4.x:auto-backport-of-pr-46842-on-1.4.x
```

5. Create a PR against branch 1.4.x, I would have named this PR:

> "Backport PR #46842 on branch 1.4.x (CI/TST: xfail git test failure on 32 bit job)"

And apply the correct labels and milestones.

Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon!

Remember to remove the `Still Needs Manual Backport` label once the PR gets merged.

If these instructions are inaccurate, feel free to [suggest an improvement](https://github.com/MeeseeksBox/MeeseeksDev).
Add "rows" as option to "axis" docstring
State: closed

The "axis" parameter of `pd.concat()` can take the string `'rows'` as an optional way of explicitly defining the default row axis for concatenation:

```python
import pandas as pd

pd.concat([pd.DataFrame(), pd.DataFrame()], axis="rows")
```

Using `'rows'` instead of `'index'` or `0` might be more intuitive as a counterpart to `'columns'`. In any case, it's a possible option, so it might be helpful to represent that in the docstring.

The proposed update in the docstring uses the suggested format based on pandas docstring guide:
https://pandas.pydata.org/docs/dev/development/contributing_docstring.html#parameter-types

>For axis, the convention is to use something like:
>axis : {0 or ‘index’, 1 or ‘columns’, None}, default None

- [ ] closes #xxxx (Replace xxxx with the Github issue number)
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.


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

Comments:
Thanks for the pull request but it appears that this change is unlikely to move forward with our pervasive usage of "index". Closing
ENH: initial support for non-nano Timestamp
State: closed

- [ ] closes #xxxx (Replace xxxx with the Github issue number)
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.


Labels:
name: Enhancement
name: Datetime
description: Datetime data dtype
name: Non-Nano
description: datetime64/timedelta64 with non-nanosecond resolution

Comments:
> So just to confirm, this PR just allows preserving the resolution from np.datetime64 objects?

Correct.  This way I can incrementally implement tests for tznaive cases, then expand to tzaware cases, etc.

> Do you have plans to support passing in resolution from the Timestamp constructor too?

Yes, though the exact API is still up in the air (xref #46587). On last week's dev call we were leaning towards a new keyword, though im still reticent, so punting on this for the time being.
@jreback gentle ping; nothing time-sensitive, but many more steps to go (ditto #46847, #46828, #46811, #46803)
TST: GH32822 data types in frame manip
State: closed

- [ ] closes #32822
- [ ] [1 Test added and passed]
- [ ] All [code checks passed]


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

Comments:
Does this look better?
Yes, could you parametrize over the nullable dtypes?

pre-commit seems to be failing
Absolutely, I appreciate the guidance! And I noticed the pre-commit issue, too. There seems to be a version issue on my local machine (between click and black), which isn't letting me check the pre-commit before committing the code.
This pull request is stale because it has been open for thirty days with no activity. Please [update](https://pandas.pydata.org/pandas-docs/stable/development/contributing.html#updating-your-pull-request) and respond to this comment if you're still interested in working on this.
Thanks @Aadharsh-Acharya
DOC: fix rsplit doc
State: closed

- [x] closes #46488 (Replace xxxx with the Github issue number)
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.

Gets rid of the `regex` argument in `.str.rsplit`. The docs for `.str.split` remains unchanged

<img width="954" alt="Screenshot 2022-04-22 at 14 07 54" src="https://user-images.githubusercontent.com/15383974/164720328-0375c2d1-ce65-45d1-81f6-968c5869f059.png">

<img width="882" alt="Screenshot 2022-04-22 at 14 10 55" src="https://user-images.githubusercontent.com/15383974/164720818-d202d4eb-fa27-4fb6-8af4-a0e3151fde0a.png">



Labels:
name: Docs

Comments:
Hello @dykim29! 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 2022-04-23 08:02:59 UTC
Importing pandas changes return value of sys.getsizeof? 
State: closed

- [X] closes #21758
- [X] [Tests added and passed]
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).


Labels:
name: Stale

Comments:
Hello @VladislavYarovenko! 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 2022-04-22 14:33:20 UTC
This pull request is stale because it has been open for thirty days with no activity. Please [update](https://pandas.pydata.org/pandas-docs/stable/development/contributing.html#updating-your-pull-request) and respond to this comment if you're still interested in working on this.
Thanks for the pull request, but it appears to have gone stale. If interested in contributing, please merge in the main branch, address any review comments and/or failing tests, and we can reopen.
added tests for the test_groupby_dropna.py
State: closed

- [ ] closes #46783

Labels:
name: Stale

Comments:
Hello @hhheidi! 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/groupby/test_groupby_dropna.py`](https://github.com/pandas-dev/pandas/blob/b467389dc1eb095b5c0d094fd43e73466cc1259d/pandas/tests/groupby/test_groupby_dropna.py):

> [Line 352:1](https://github.com/pandas-dev/pandas/blob/b467389dc1eb095b5c0d094fd43e73466cc1259d/pandas/tests/groupby/test_groupby_dropna.py#L352): [E302](https://duckduckgo.com/?q=pep8%20E302) expected 2 blank lines, found 1
> [Line 363:38](https://github.com/pandas-dev/pandas/blob/b467389dc1eb095b5c0d094fd43e73466cc1259d/pandas/tests/groupby/test_groupby_dropna.py#L363): [E231](https://duckduckgo.com/?q=pep8%20E231) missing whitespace after ','
> [Line 380:45](https://github.com/pandas-dev/pandas/blob/b467389dc1eb095b5c0d094fd43e73466cc1259d/pandas/tests/groupby/test_groupby_dropna.py#L380): [W292](https://duckduckgo.com/?q=pep8%20W292) no newline at end of file


This pull request is stale because it has been open for thirty days with no activity. Please [update](https://pandas.pydata.org/pandas-docs/stable/development/contributing.html#updating-your-pull-request) and respond to this comment if you're still interested in working on this.
Thanks for the pull request, but it appears to be stale and is failing a lot of the CI checks. If interested in continuing, please fix the formatting and tests failures locally and we can reopen.
BUG: Timedelta(td64, unit=foo) silent overflow
State: closed

- [ ] closes #xxxx (Replace xxxx with the Github issue number)
- [x] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [x] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.


Labels:
name: Bug
name: Timedelta
description: Timedelta data type

Comments:
Thanks @jbrockmendel
REF: remove unnecessary args in libparsing
State: closed

- [ ] closes #xxxx (Replace xxxx with the Github issue number)
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.


Labels:
name: Refactor
description: Internal refactoring of code
name: Datetime
description: Datetime data dtype

Comments:
Thanks @jbrockmendel
ENH: adding saving and reading of dataframe `attrs` field in parquet metadata
State: closed

I implemented the saving and reading of the custom `attrs` field of a dataframe inside parquet files. This is done using a field called `"pandas_attrs"` inside the parquet metadata, even though this passage is hidden to the user, who can just keep on using `to_parquet` and `pandas.read_parquet` as before.
I hope it might be interesting to someone to use, since it allows to retain information which otherwise would need custom setup or be lost.

I left some 'TODOs', even though may not be strictly necessary.

The modifications allow for this paradigm to be implemented for both engines, i.e. `pyarrow` and `fastparquet`, with their own caveats. 

I wrote a simple pytest, which I locally managed to pass. I am not 100% sure it is the correct way, even though I follow the [guidelines](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests).

I shall leave some default checklist, but I am not sure it is needed.
- [x] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).

Labels:
name: Stale

Comments:
Hello @LeonardoAlchieri! 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 2022-04-21 14:11:41 UTC
This pull request is stale because it has been open for thirty days with no activity. Please [update](https://pandas.pydata.org/pandas-docs/stable/development/contributing.html#updating-your-pull-request) and respond to this comment if you're still interested in working on this.
REF: avoid ravel in DatetimeArray.to_period
State: closed

- [ ] closes #xxxx (Replace xxxx with the Github issue number)
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.


Labels:
name: Refactor
description: Internal refactoring of code
name: Datetime
description: Datetime data dtype
name: Period
description: Period data type

Comments:
Thanks @jbrockmendel
ENH: Add axis=None for statistical methods
State: closed

Issue #43889. Adding axis=None option for statistical methods: .min, .max, .median, and .mean.

Labels:
name: Stale

Comments:
Hello @romedina15! 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 2022-04-20 22:27:50 UTC
This pull request is stale because it has been open for thirty days with no activity. Please [update](https://pandas.pydata.org/pandas-docs/stable/development/contributing.html#updating-your-pull-request) and respond to this comment if you're still interested in working on this.
Thanks for the pull request, but it appears to have gone stale. If interested in contributing, please merge in the main branch, address any review comments and/or failing tests, and we can reopen.