BrandonFors/pandas-github-issues huggingface dataset:
Added an edge case handler and a test case for Series.first("#M")
State: closed

- [x] closes #51285
- [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.

As described in the above issue, first("1M") does not include timestamps of the last day of a month that are beyond "00:00:00". The problem happens to "2M", "3M", etc., where MonthEnd is being used.

To fix it, I added an if-statement in first() to check whether the offset variable is an instance of MonthEnd. If it is, the end date will be adjusted one day forward, and the returned range will end till the last timestamp before the end date.

I also added a test case in test_first_and_last.py and passed it.

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.
add pytables to 3.11 ci environment
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:
Thanks for the PR, but I don't think we want to turn this on for 3.11 since we should have near equivalent pytables coverage on 3.8, 3.9, 3.10 so closing
CLN: some cleanups in Series.apply & related
State: closed

Some cleanups:

* Move the `convert_dtype` warning from `Series.apply` to `SeriesApply`
* Add `*, ` to force use use of keywords
* Set the default for `convert_dtype` in `SeriesApply` to `no_default`
* Drop setting `convert_dtype` internally in `Series.agg`  & `Series.transform` (these are noops, i.e. have no effect)


Labels:
name: Clean
name: Apply
description: Apply, Aggregate, Transform, Map

Comments:
Thanks @topper-123 
it looks like this caused a performance regression https://asv-runner.github.io/asv-collection/pandas/#join_merge.ConcatDataFrames.time_c_ordered?p-axis=0

could you take a closer look?
I've bisected this and the regression is actually caused by https://github.com/pandas-dev/pandas/pull/52685.
thx, this pr looked weird, but didn't have time to investigate more. The other makes more sense
replace KeyError with LookupError in the types of possible read_hdf errors
State: closed

- [x] closes #52781 (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: IO HDF5
description: read_hdf, HDFStore

Comments:
yep I'm just working on a test now
@mroeschke what do you think about using BaseException instead?
Thanks @graingert
DOC add example of Series.index #51842 
State: closed

 A newline between the text and the code is missing.

- [ ] 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 @ggold7046
DOC: Adding docstrings to functions #15580 
State: closed

Addresses issue #15580 in the Pandas library
Adding docstrings with examples to 
using_copy_on_write() and 
using_nullable_dtypes() functions, pathway 

Files under C:\Users\XXXX\pandas\pandas\_config|__init__py

Labels:

Comments:
Please reach out with any questions or edits you think I should make. 
I have made the requested changes and ready for the review process to continue. 
No offense taken, I am using chatbot as a guide but not the only resource I am using to understand the functions. 
I'll resubmit later once I fully know the ins and outs of the functions if you don't mind.
TST: Add regression test for NaN sparse columns
State: closed

- [x] closes #27781
- [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


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

Comments:
Thanks @ConnorMcKinley
REF: de-duplicate Manager concat paths
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:
name: Internals
description: Related to non-user accessible pandas implementation

Comments:
Just a merge conflict
rebased+green
Thanks @jbrockmendel
BUG: pandas.DataFrame.last doesn't respect time zone #52131
State: closed

- [ ] closes #52131 (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:
Pls add tests for the relevant bug
thanks @jgarba for having worked on this

we've discussed `first` and `last`, and we'll be deprecating them, see https://github.com/pandas-dev/pandas/issues/45908#issuecomment-1525822630

closing this for now then, but thanks for your PR!
TYP: nargsort
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.

Some simplification available if im right about #52764

Labels:
name: Refactor
description: Internal refactoring of code
name: Typing
description: type annotations, mypy/pyright type checking

Comments:
Thanks @jbrockmendel
PERF: dtype checks
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:
name: Performance
description: Memory or execution speed performance

Comments:
Thanks @jbrockmendel
BUG: ArrowExtensionArray returning approximate median
State: closed

- [x] closes #52679 (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.
- [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: Reduction Operations
description: sum, mean, min, max, etc.
name: Arrow
description: pyarrow functionality

Comments:
LGTM
BUG: interchange categorical_column_to_series() should not accept only PandasColumn
State: closed

- [ ] closes #49889 (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.

cc @AlenkaF 

---

I've added this to the 2.0.1 whatsnew, and it's a trivial 1-line change (which was only there to begin with to help type checkers, it doesn't have any runtime purpose) and it unlocks a fair bit

Labels:
name: Interchange
description: Dataframe Interchange Protocol

Comments:
Thank you @MarcoGorelli! LGTM +1
Just a merge conflict
Thanks @MarcoGorelli
TST: Regression test added for .loc assignements 
State: closed

- [x] closes #29707 
- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).


Labels:
name: Stale
name: Sprints
description: Sprint Pull Requests

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.
closing as per the above, but please do ping if you're still interested in this
TST: Test for index of dict keys as tuples
State: closed

- [x] closes #22077
- [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.
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.

@phofl @jorisvandenbossche @noatamir @MarcoGorelli 


Labels:
name: Sprints
description: Sprint Pull Requests

Comments:
Thanks @sortofamudkip
TST: Test groupby for columns with string objects
State: closed

- [ ] closes #24196 
- [ ] [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.

@phofl 
@noatamir 
@jorisvandenbossche 
@MarcoGorelli 




Labels:
name: Testing
description: pandas testing functions or related to the test suite
name: Groupby
name: Sprints
description: Sprint Pull Requests

Comments:
thx @gmaiwald
Typing: Narrow down types of arguments (NDFrame)
State: closed

- [x] closes parts of # 10 (in https://github.com/noatamir/pydata-workshop)
- [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.

Updated item 11-14 (15 seemed already done):
 - [x] Specify method in to_sql more precisely
 - [x] Specify errors in to_csv more precisely
 - [x] Specify mode in to_csv more precisely
 - [x] Specify kind and na_position in sort_values more precisely

Labels:
name: Sprints
description: Sprint Pull Requests

Comments:
@phofl @noatamir 
Thanks for the PR @kjanker! There are a couple of errors identified by pre-commit, which I think you can solve yourself. Let me know if you need help understanding the errors.
Thanks @kjanker!
changed str to literal in inteprolate and limit_direction
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:
name: Sprints
description: Sprint Pull Requests

Comments:
Worked on [Issue 10](https://github.com/noatamir/pydata-workshop/issues/10) for the following points:

- Specify method in interpolate more precisely
- Specify limit_direction in interpolate more precisely

Please review the code: @phofl, @noatamir, @jorisvandenbossche, @MarcoGorelli
Thanks @VanMyHu!
Typing: Narrow down types of arguments (NDFrame) #10
State: closed

[Typing: Narrow down types of arguments (NDFrame) #10](https://github.com/noatamir/pydata-workshop/issues/10)
Made these specifications to Literals:
- [ X] Specify date_unit in to_json more precisely
- [ X] Specify mode in to_hdf more precisely
- [ X] Specify complib in to_hdf more precisely
- [ X] Specify format in to_hdf more precisely

@phofl @jorisvandenbossche @noatamir @MarcoGorelli 

Labels:
name: Sprints
description: Sprint Pull Requests

Comments:
Thanks for the PR @mKlepsch! The CI caught some errors which I think you can solve locally if you run pre-commit. Let us know if you need help. 
Hope it works now!
Hi, I can't figure out why it is still failing the CI. Could you give me some pointers?
you'll need to run the pre-commit hooks, please check the contributing guide for how to do that
You can do:

```
pre-commit install
pre-commit run --all-files
```

(It's probably a space at the end of the line, which is disallowed


Thanks @mKlepsch
Typing: Narrow down types of argument keep for nsmallest and nlargest
State: closed

- [ ] Typing: Narrow down types of arguments (Series) for nsmallest and nlargest
- [ ] [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: Sprints
description: Sprint Pull Requests

Comments:
Thanks for the PR @mattkeanny! The CI caught some errors which I think you can solve locally if you run pre-commit. Let us know if you need help.
Thanks @mattkeanny!
TYP: Narrow down types of arguments (DataFrame)
State: closed

closes https://github.com/pandas-dev/pandas/issues/8 (https://github.com/noatamir/pydata-workshop/issues/8)
 [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.
Preview discussion:
We prefer using Literal["a"] | Literal["b"] instead of str. Look into the documentation what is allowed and the narrow the types down appropriately. Generally, we probably already have type definitions in pandas/_typing.py like NaPosition for the first item in the list below.

You can locate the appropriate file through searching for class DataFrame in the repository.

DataFrame methods:

- Specifykind and na_position more precisely in sort_values (can look at sort_index, it is already done there)
- Specify keep for nsmallest and nlargest more precisely
- Specify join and errors in update more precisely
- Specify na_action in applymap more precisely
- Specify validate in merge and join more precisely
- Specify how in to_timestamp more precisely
- Specify orient in from_dict more precisely
- Specify if_exists in to_gbq more precisely
- Specify byteorder in to_stata more precisely
- Specify engine in to_parquet more precisely
- Specify engine in to_orc more precisely
- Specify parser in to_xml more precisely
- Specify method in reindex more precisely

#Reviewers
@phofl @noatamir @jorisvandenbossche and @MarcoGorelli

Labels:
name: Sprints
description: Sprint Pull Requests

Comments:
Help, @phofl - i keep getting a mypy error 
```
pandas/core/frame.py:1738: error: Incompatible types in assignment (expression has type "str", variable has type "Literal['columns', 'index', 'tight']")  [assignment]
Found 1 error in 1 file (checked 1418 source files)
```

this is completely new to me, so I do not have any idea how to fix that. Could you help out, please?
@benedikt-mangold: Since we changed `orient` from str to Literal `orient` must be of type Literal. Maybe we could remove the line 1738 in frame.py `orient = orient.lower()` at all. 
@phofl Would this be ok in terms of backward compatibility?
This is an annoying case…

You can add „  type: ignore[assignment]“ after the lower in the same line.

no we would have to deprecate first, which is something I’d be open to do. But not in this pr (we try to keep things separated)
@pschleiter and @phofl  -> worked, build is green 🎉 
@pschleiter and @phofl - halp -> why on earth would it be red now ??
> @pschleiter and @phofl - halp -> why on earth would it be red now ??

merging did not contain all changes in .typing.py
@phofl ready to merge 🎉 
Thanks @benedikt-mangold
DataFrame.join Copy-on-Write optimization tests
State: closed

- [x] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests)
- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).

@phofl @noatamir @jorisvandenbossche @MarcoGorelli Could you guys please review this PR? Thanks again for the session today.

Labels:
name: Reshaping
description: Concat, Merge/Join, Stack/Unstack, Explode
name: Copy / view semantics
name: Sprints
description: Sprint Pull Requests

Comments:
Thanks for the PR @SecretLake! The CI caught some errors which I think you can solve locally if you run pre-commit. Let us know if you need help.
Thanks for the feedback @noatamir. I don‘t see any errors in the CI. Could you pls point me to the failed runs? 
Oops. I thought I saw one earlier. My bad 🙈 
thx @SecretLake
Changed in as requested in #52716 and added test for checking this issue
State: closed

- [ ] Changed in as requested in #52716. Test for checking this issue was added as well. 

- [ ] 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: Sprints
description: Sprint Pull Requests

Comments:
Thanks for the PR @NikolayBoev! The CI caught some errors which I think you can solve locally if you run pre-commit. Let us know if you need help.
add documentation for read_excel with dtype_backend='pyarrow'
State: closed

- [x] closes #52743 


Labels:
name: Stale
name: Sprints
description: Sprint Pull Requests

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.