BrandonFors/pandas-github-issues huggingface dataset:
fix issue #60410
State: closed

- [ ] closes #60410 (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 [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [ ] 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

Comments:
Thanks @partev
fix issue #60410
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 [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [ ] 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:
will resubmit
DOC: Fix docstrings for boxplot, get_group, and indices methods
State: closed

Fixes docstrings of below methods

```
-i "pandas.core.groupby.DataFrameGroupBy.boxplot PR07,RT03,SA01" \ 
 -i "pandas.core.groupby.DataFrameGroupBy.get_group RT03,SA01" \ 
 -i "pandas.core.groupby.DataFrameGroupBy.indices SA01" \ 
```

Labels:
name: Stale

Comments:
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.
Fix BUG: Cannot shift Intervals that are not closed='right' (the default)
State: closed

- [x] closes #60389 
- [x] Tests added and passed
- [x] All code checks passed

I made a small modification by adding the closed attribute when creating empty positions for movement. Now we can output the moved result correctly according to the requirements in the issue
```
0           NaN
1    [1.0, 2.0)
dtype: interval
```

At the same time, I added a little test for this modification.

If my understanding of the problem is beyond the problem, or if my modifications are incorrect, please feel free to point them out


Labels:
name: Interval
description: Interval data type

Comments:
Thanks @lfffkh
DOC: Update variables a and b to names consistent with comment documentation
State: closed

- [x] closes #60366

This PR updates variable names a and b to left_op and right_op across relevant functions to improve code readability and align with the naming conventions described in the documentation. These changes enhance the clarity of the codebase by using descriptive variable names that reflect their role in operations.


1. Updated Function Definitions:
- a → left_op
- b → right_op

Labels:
name: Stale

Comments:
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: Fix formatting of complex floats with exponents
State: closed

- [x] closes #60393
- [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).

```
>>> input_array=[(1.8816e-09+0j), (3.39676e-09+0j)]
>>> pd.Series(input_array)
0    1.881600e-09+0.000000e+                    00j
1    3.396760e-09+0.000000e+                    00j
dtype: complex128
```

The issue was due to the regex in the _trim_zeros_complex function not being able to handle +/- in the exponent. It assumes the complex number string to be of the form (-)xxx(+/)yyyj. I fixed the regex so it doesn't split on +/- if preceded by an exponent.
Post the fix:

```
>>> input_array=[(1.8816e-09+0j), (3.39676e-09+0j)]
>>> pd.Series(input_array)
0    1.881600e-09+0.000000e+00j
1    3.396760e-09+0.000000e+00j
dtype: complex128
```

Labels:
name: Output-Formatting
description: __repr__ of pandas objects, to_string

Comments:
Looks like I broke my branch. Will re-raise the PR.
CI/BUG: Remove `trim()` function on `comment-commands.yml`
State: closed

- [x] closes #60396 (Replace xxxx with the GitHub issue number)

Since there are no trim or related split commands on github workflows, you'd have to use a shell to be able to trim it. 
See: https://stackoverflow.com/questions/64049306/github-actions-how-to-trim-a-string-in-a-condition
```steps:
  ...
  - name: Check if person has accepted and signed CLA
    shell: python
    run: |
      import sys

      def check_user_accepted_and_signed(text):
        """Some complex natural language processing will go here"""
      
      comment = '''${{ github.event.comment.body }}'''
      if not check_user_accepted_and_signed(comment):
        sys.exit(1)  # This will abort the job
  - name: Not accepted or signed
    if: ${{ failure() }}
    run: optionally do something if the check fails
  - name: Move on if the check passed
    run: ...
```
Which in my opinion would be a lot of work and extra compute time for a simple "strip" on comments. I suggest to revert it as original.



Labels:
name: CI
description: Continuous Integration

Comments:
Thanks @KevsterAmp no worries with introducing the failure
DEPR: Raise `FutureWarning` about raising an error in __array__ when copy=False cannot be honored
State: closed

- [x] closes #60340(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).


Labels:
name: Compat
description: pandas objects compatability with Numpy or Python functions
name: Deprecate
description: Functionality to remove in pandas

Comments:
Thanks for the review despite this PR being in draft. Working on the tests and changes based on the comments, will mark it as ready once done
Re-marking this as draft since I'll be fixing the errors on CI
@KevsterAmp do you have time to update this?
```bash
=================================== FAILURES ===================================
___________________________ test_to_parquet_new_file ___________________________
[gw1] linux -- Python 3.12.8 /home/runner/micromamba/envs/test/bin/python3.12
[XPASS(strict)] TODO(infer_string) fastparquet
```
@KevsterAmp thanks a lot for the contribution!
Thanks @jorisvandenbossche !
BUG (string dtype): comparison of string column to mixed object column fails #60228 (fixed)
State: closed

#### Changes :
- Updated `comparison_op` function in `pandas/core/ops/array_ops.py`:
  - Added handling for comparisons between `string` and `object` dtypes.
  - Ensured `string` and `object` types are casted to a common type (`string`) before comparison.
- Added a test case to validate the fix:
  - Verified comparison works for `string` vs `object` with homogeneous and mixed types.
  - Verified behavior with PyArrow-based strings enabled (`pd.options.future.infer_string = True`).

--

- [x] closes #60228  (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 [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [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: Strings
description: String extension data type and string data
name: Stale

Comments:
@TEARFEAR git workflow related comment: it seems you have picked up some unrelated commits. In general doing something like

```
git fetch upstream
git merge upstream/main
git push origin bug-update-60228
```

should fix that (assuming `origin` is your fork and `upstream` is the pandas-dev/pandas remote)
(small ping to see if you have some time to update this PR)
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.
@TEARFEAR would you have time to update this PR? (otherwise I am also happy to update it, as we would like to include this in the 2.3 release)
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.
TST: Add test for retaining dtype of datetime columns in `DataFrame.to_hdf`
State: closed

- [x] closes #60353 (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).


Labels:
name: Stale

Comments:
not exactly sure how to fix this but the tests seem to raise an error on the "infer strings" CI. Seeking guidance on this one. Thanks in advance
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.
DOC: Fix doc string for column C&C
State: closed

This inconsistency was introduced by #58749.
- [ ] 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 [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [ ] 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

Comments:
Thanks @mahlzahn
feat: Implement option 'delete_rows' of argument 'if_exists' in 'DataFrame.to_sql' API.
State: closed

- [x] closes #37210 
- [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 [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [x] Added an entry in the latest `doc/source/whatsnew/v3.0.0.rst` file if fixing a bug or adding a new feature.


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

Comments:
@WillAyd I chose the name `delete_rows` instead of `delete_replace` because the behavior of `replace` right now is of `recreate` - as you [mentioned](https://github.com/pandas-dev/pandas/issues/37210#issuecomment-2486756761) - and `delete_rows` means exactly what is going on behind the scenes.

@erfannariman tagging you due to your help/interest during the lifecycle of this issue.
~~@WillAyd it seems new tests have introduced some sort of "lock" on pytest. It is affecting 3.11, 3.12 and "Future infer strings" using a single CPU (it works using multiple). Do you have any hunch ?~~

NVM. CI is fine now.
blocked by https://github.com/pandas-dev/pandas/pull/60748. Changing to draft.
Hello @WillAyd  and @mroeschke,
I believe the merge of https://github.com/pandas-dev/pandas/pull/60748 has unblocked this one. Would you guys mind taking a look ? I'm resolving all conversations so we can start fresh on this.
Thanks @gmcrocetti 
Thanks a lot for reviewing it folks. A special thanks to @WillAyd who reviewed the two PRs multiple times 🙇 .
Appreciated !
DOC: Fix docstrings for SeriesGroupBy monotonic and nth
State: closed

part of #60365 

```
 -i "pandas.core.groupby.SeriesGroupBy.is_monotonic_decreasing SA01" \ 
 -i "pandas.core.groupby.SeriesGroupBy.is_monotonic_increasing SA01" \ 
 -i "pandas.core.groupby.SeriesGroupBy.nth PR02" \ 
 -i "pandas.core.groupby.DataFrameGroupBy.nth PR02" \
```

Labels:
name: Docs

Comments:
Thanks @ensalada-de-pechuga
TST: Added test for pivot_table with int64 dtype and dropna parameter
State: closed

- [x] closes #47971
- [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).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [ ] 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: Testing
description: pandas testing functions or related to the test suite

Comments:
Thanks @AbhishekChaudharii 
Happy to help!
TST: Added test for pivot_table with int64 dtype and dropna parameter
State: closed

- [x] closes #47971
- [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).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [ ] 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:
Closing this PR as it is identical to #60374
Fixing the issue
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 [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [ ] 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:
pre-commit.ci autofix
ENH: add trim() to github.event.comment.body on issue_assign workflow job
State: closed

- [x] closes #60358 (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 [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [ ] 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: CI
description: Continuous Integration

Comments:
Thanks @KevsterAmp 
not super familiar with gha - but this ~~doesn't seem to be working.~~ I mean, I don't like the notification spam. unclear whether that's expected.

> The workflow is not valid. .github/workflows/comment-commands.yml (Line: 14, Col: 9): Unrecognized function: 'trim'. Located at position 39 within expression: (!github.event.issue.pull_request) && trim(github.event.comment.body) == 'take'

see: https://github.com/pandas-dev/pandas/actions/runs/11973220181/workflow
@asishm - Thanks for the report, confirmed that I can't also use take as of the moment. I'll open an issue and create a PR to revert this. From further investigation, looks like github workflows doesn't have any `trim` or similar related function in the docs. I guess the original CI would be fine.
BUG: Copy attrs on pd.merge()
State: closed

This uses the same logic as `pd.concat()`: Copy `attrs` only if all input `attrs` are identical.

I've refactored the handling in __finalize__ from special-casing based on th the method name (previously only "concat") to handling "other" parameters that have an `input_objs` attribute. This is a more scalable architecture compared to hard-coding method names in __finalize__.

Tests added for `concat()` and `merge()`.

Closes #60351.


Labels:
name: Reshaping
description: Concat, Merge/Join, Stack/Unstack, Explode
name: metadata
description: _metadata, .attrs

Comments:
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.
> 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.

I'm still interested in this, and IMHO it's ready for review.
Sorry @timhoffm nobody reviewed this. We don't have many people reviewing nowadays, and some PRs are never reviewed. Do you mind updating your branch and adding a release note? I'll try to have a look at this soon.

@rhshadrach I think you checked this already when discussed in the issue. If you have time to have a look at the implementation, that would be great.
Thanks for sticking with this @timhoffm
Fix Bug: last column missing formatting in Latex (#52218)
State: closed

Redo of #60239 but using a feature branch this time :-)

- [x] closes #52218 
- [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: IO LaTeX
description: to_latex
name: Styler
description: conditional formatting using DataFrame.style

Comments:
Ok I looked a little more at this. The original problem was phrased as not applying to the last column for a styling function that should apply to the whole row. **However** that isn't really the nature of the problem.

E.g.
<img width="469" alt="Screenshot 2024-11-19 at 20 36 18" src="https://github.com/user-attachments/assets/77524391-e155-4cd6-b0fc-7c1e30deec12">

Notice that Latex translate seems to get out of line for hidden columns.
> Ok I looked a little more at this. The original problem was phrased as not applying to the last column for a styling function that should apply to the whole row. **However** that isn't really the nature of the problem.
> ....

Ah interesting... that makes sense.
Thanks @corbanvilla
TST (string dtype): clean-up assorted xfails
State: closed

@jorisvandenbossche @WillAyd opening as draft and will add more to this PR over time (as I find solvable ones).

Labels:
name: Strings
description: String extension data type and string data
name: Stale

Comments:
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.
Appears this PR has gone stale. Feel free to reopen if/when you have time to revisit
Update citing.md to correct the invalid URL
State: closed

Correct the invalid URL on line 23 to a valid one.

- [ ] 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).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [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: Docs

Comments:
Thanks @setbit123
[backport 2.3.x] TST (string dtype): clean-up assorted xfails (#60345)
State: closed

(cherry picked from commit e7d1964ab7405d54d919bb289318d01e9eb72cd1)

Backport of #60345

Labels:

Comments:
@jorisvandenbossche #59481 is marked as backported but I'm not sure it was so I think that's why you had merge conflicts in pandas/tests/io/excel/test_readers.py and why there is still an xfail on 2.3.x for test_dtype_backend_string
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.
> @jorisvandenbossche #59481 is marked as backported but I'm not sure it was so I think that's why you had merge conflicts in pandas/tests/io/excel/test_readers.py and why there is still an xfail on 2.3.x for test_dtype_backend_string

That PR was certainly backported _at least partly_, but of course it might always be that some merge conflicts were resolved incorrectly so that not every change was fully applied to 2.3.x. 

And indeed in test_readers.py there seems to be some leftovers. Thanks for the notice!
> And indeed in test_readers.py there seems to be some leftovers. 

Turns out it was only the xfail itself that was not properly removed, the actual test code changes were backported properly -> fixup in https://github.com/pandas-dev/pandas/pull/60599