BrandonFors/pandas-github-issues huggingface dataset:
TYP/REF: remove mypy ignore from localization.py
State: closed

Related to https://github.com/pandas-dev/pandas/issues/37715
- [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).


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

Comments:
Thanks @Moisan
Bump cython version in asv.conf.json to match environment.yml
State: closed

- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).

Aligning asv.conf.json with recent bump of cython in environment.yml. 

Labels:
name: Benchmark
description: Performance (ASV) benchmarks

Comments:
thanks @lukemanley
Create eval test
State: closed

I added an additional unit test for `pandas.eval('True and not True')` from the Mar 22, 2019 comment.

- [X] closes #25823 
- [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 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
name: expressions
description: pd.eval, query

Comments:
thanks @djgray780
PERF: groupby.apply on a non-unique, unsorted index
State: closed

- [x] closes #46527
- [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` 


Added the following asv to cover this case:

```
from asv_bench.benchmarks.groupby import ApplyNonUniqueUnsortedIndex

b = ApplyNonUniqueUnsortedIndex()
b.setup()

%timeit b.time_groupby_apply_non_unique_unsorted_index()
```

```
2.16 s ± 163 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)     <- main
7.1 ms ± 207 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)  <- PR
```

Labels:
name: Groupby
name: Performance
description: Memory or execution speed performance

Comments:
thanks @lukemanley very nice!
API: Disallow sets as index and columns argument in DataFrame constructor
State: closed


- [x] closes #47215 
- [x] `pandas/tests/frame/test_constructors.py` method `test_columns_indexes_raise_on_sets`
- [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.

Note:  This also allowed some typing changes removing some `#type: ignore` statements

Labels:
name: Typing
description: type annotations, mypy/pyright type checking
name: Constructors
description: Series/DataFrame/Index/pd.array Constructors
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.
@jreback have merged with latest master.  You were last to review - suggesting using `ensure_index()`, but that created test failures.
hmm https://github.com/pandas-dev/pandas/runs/7271930917?check_suite_focus=true

i thinksomething changed on master for types......
> hmm https://github.com/pandas-dev/pandas/runs/7271930917?check_suite_focus=true
> 
> i thinksomething changed on master for types......

Yes, there was a change made that made the `_set_axis()` parameter have too wide a type.  It included `Sequence`, and I changed it to `list`

We have to avoid using `Sequence` in general, and `Sequence[str]` specifically because a plain string will match either.

Next commit addresses that.
thanks @Dr-Irv lgtm.
ENH: preserve non-nano DTA/TDA in Index/Series/DataFrame
State: closed

Continue to cast non-nano ndarrays, but if a user goes out of there way to create a non-nano DTA/TDA, preserve it in the other constructors.

Labels:
name: Non-Nano
description: datetime64/timedelta64 with non-nanosecond resolution

Comments:
cc @datapythonista 
Looks really cool.

Not sure if for the tests I'd compare to the literal of the dtype we expect. We're testing that the type of the array are preserved. This could be tested in general (not sure if it is), but feels a bit strange that this is done in the tests specific to non-nano, instead of making sure the dtype is the non-nano we want. Not important, just sharing, if you like this approach better, is fine with me. I guess we're testing the dtype of the array elsewhere already.
Thanks @jbrockmendel
DEPS: drop np 18 supoort
State: closed


Labels:
name: Dependencies
description: Required and optional dependencies

Comments:
```
=================================== FAILURES ===================================
______________________________ test_where_dt64_2d ______________________________
[gw1] linux -- Python 3.8.0 /usr/share/miniconda/envs/pandas-dev/bin/python
    def test_where_dt64_2d():
        dti = date_range("2016-01-01", periods=6)
        dta = dti._data.reshape(3, 2)
        other = dta - dta[0, 0]
        df = DataFrame(dta, columns=["A", "B"])
        mask = np.asarray(df.isna())
        mask[:, 1] = True
        # setting all of one column, none of the other
        expected = DataFrame({"A": other[:, 0], "B": dta[:, 1]})
>       _check_where_equivalences(df, mask, other, expected)
pandas/tests/frame/indexing/test_where.py:1019: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
df =            A          B
0 2016-01-01 2016-01-02
1 2016-01-03 2016-01-04
2 2016-01-05 2016-01-06
mask = array([[False,  True],
       [False,  True],
       [False,  True]])
other = <TimedeltaArray>
[
['0 days', '1 days'],
['2 days', '3 days'],
['4 days', '5 days']
]
Shape: (3, 2), dtype: timedelta[64](https://github.com/pandas-dev/pandas/runs/6739385945?check_suite_focus=true#step:9:65)[ns]
expected =        A          B
0 0 days 2016-01-02
1 2 days 2016-01-04
2 4 days 2016-01-06
    def _check_where_equivalences(df, mask, other, expected):
        # similar to tests.series.indexing.test_setitem.SetitemCastingEquivalences
        #  but with DataFrame in mind and less fleshed-out
        res = df.where(mask, other)
>       tm.assert_frame_equal(res, expected)
E       AssertionError: Attributes of DataFrame.iloc[:, 0] (column name="A") are different
E       
E       Attribute "dtype" are different
E       [left]:  int64
E       [right]: timedelta64[ns]
pandas/tests/frame/indexing/test_where.py:990: AssertionError
```
thanks @fangchenli 

I wouldn't mind actually bumping to 1.20+ per: https://numpy.org/neps/nep-0029-deprecation_policy.html

but no big deal to keep here as well.
BUG Fix: pd.apply returns a dataframe when empty dataframe instead of a series
State: closed

- [ ] closes #39111
- [ ] [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: Bug
name: Apply
description: Apply, Aggregate, Transform, Map

Comments:
The test looks good, but you're applying the fix in the wrong location. Maybe debugging the test code helps you identify where the empty `DataFrame` is created.
Thanks @weikhor
ASV: add benchmark for reindex with MultiIndex containing dates
State: closed

- [x] closes #23735
- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).

Adding a benchmark per the discussion in the linked issue. 

```
from asv_bench.benchmarks.reindex import Reindex

b = Reindex()
b.setup()

%timeit b.time_reindex_multiindex_no_cache_dates()
```

```
603 ms ± 20.5 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)    <- 1.4.2
45.6 ms ± 995 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)  <- main
```

Labels:
name: Benchmark
description: Performance (ASV) benchmarks

Comments:
thanks @lukemanley very nice!
REF: remove ensure_datetime64ns, ensure_timedelta64ns
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: Datetime
description: Datetime data dtype
name: Clean

Comments:
Thanks @jbrockmendel
Update PSF_LICENSE
State: closed

Corrections on some misspelled words on the PSF_LICENSE.

- [ ] 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: Stale

Comments:
Spellings are updated on the PSF_LICENSE.
@chineduG do you have time to address the comments? If you check the diff, you will quickly see that the format of your changes is not correct. It's fine to update the text, but the format should be the same, not all these blank lines that make really hard to read the document.
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 stale. @chineduG if you still want to address the comments and continue working on this please let us know to reopen.
REF: Store dataframe protocol column buffers in attrs
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).

Before storing dataframe exchange column buffers in `_buffers` would warn

```
UserWarning: Pandas doesn't allow columns to be created via a new attribute name - see https://pandas.pydata.org/pandas-docs/stable/indexing.html#attribute-access
```

Looks like these aren't used anywhere yet, but to be associate with the DataFrame, it's more natural to store in `attrs`

cc @vnlitvinov 


Labels:
name: Refactor
description: Internal refactoring of code

Comments:
looks fine, @vnlitvinov if any comments
Can follow up with any comments if needed.
BUG: Cannot map MultiIndex to more levels
State: closed

- [x] closes #24800 
- [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: MultiIndex
name: Stale

Comments:
@simonjayhawkins I updated the code to reflect [#24800 (comment)](https://github.com/pandas-dev/pandas/issues/24800#issuecomment-455069121).

Furthermore, I removed the name preservation completely. Keeping the other check,

```python
if self.name:
    names = [self.name] * len(new_values[0])
else:
    names = None
```

would set `names` the first time we switch from an `Index` to a `MultiIndex` but would be lost in successive `map` operations since `MultiIndex` does not set/have a `name` property. Thus, I removed this check as well.

EDIT: There are 5 failing tests which expect a name preservation from `MultiIndex` to `MultiIndex` and one test which expects a name preservation from `Index` to `MultiIndex`. How should this be resolved?
> EDIT: There are 5 failing tests which expect a name preservation from `MultiIndex` to `MultiIndex` and one test which expects a name preservation from `Index` to `MultiIndex`. How should this be resolved?

we may need to deprecate the existing behavior. cc @jorisvandenbossche @toobaz  (from #24800 discussion)
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: Added docstrings to fixtures defined in array module
State: closed

Partially addresses #19159.

- [ ] 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: Testing
description: pandas testing functions or related to the test suite
name: Docs

Comments:
very nice @melissawm keep em coming!
BUG: PeriodArray.__add__(array_of_ints)
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: Numeric Operations
description: Arithmetic, Comparison, and Logical operations
name: Period
description: Period data type

Comments:
Thanks @jbrockmendel
BUG Fix: Allow using datetime64[ns, UTC] in IntervalDtype
State: closed

- [ ] closes #46999
- [ ] [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: Timezones
description: Timezone data dtype
name: Interval
description: Interval data type

Comments:
Thanks @weikhor!
REGR: concat not sorting columns for mixed column names
State: closed

- [x] closes #47127 (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.

The except clause can be removed in 1.5 through handling cases like [1, "a", None] in algorithms, but this would change the behavior a bit so would avoid backporting


Labels:
name: Reshaping
description: Concat, Merge/Join, Stack/Unstack, Explode
name: Regression
description: Functionality that used to work in a prior pandas version

Comments:
very nice @phofl 
@meeseeksdev backport 1.4.x
Could not push to auto-backport-of-pr-47206-on-1.4.x due to error, aborting.
REF: share DTA/TDA/PA arithmetic methods
State: closed

This became bigger than I expected, happy to split it into pieces upon request.

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

Comments:
can you rebase
rebased + green
Thanks @jbrockmendel
BUG: Tackle GH47203; Ensure body is non-empty when accessing row_body_cells
State: closed

- [x] closes #47203
- [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).
- [x] Added an entry in the latest `doc/source/whatsnew/v1.5.0.rst` file.


Labels:
name: IO LaTeX
description: to_latex

Comments:
thanks @tomaarsen
BUG: StataWriter value_label encoding
State: closed

- [x] closes #46750
- [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).
- [x] Added an entry in  `doc/source/whatsnew/v1.5.0.rst`


Labels:
name: IO Stata
description: read_stata, to_stata

Comments:
thanks @eirki
ENH: Move SettingWithCopyWarning to error/__init__.py per GH27656
State: closed

- [x] xref #27656. this GitHub issue is being done in multiple parts
- [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: Warnings
description: Warnings that appear or should be added to pandas

Comments:
Thanks again @dataxerik. Great progress on this issue
BUG: Period + np.timedelta64(nat)
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: Numeric Operations
description: Arithmetic, Comparison, and Logical operations
name: Period
description: Period data type

Comments:
Thanks @jbrockmendel
updated period.daysinmonth definition to match period.days_in_month
State: closed

- [DOC] The definition for period.daysinmonth in the .pyx file was worded slightly differently than period.days_in_month, despite both methods being exactly the same. This change updates the definition of daysinmonth to match that of days_in_month. 


Labels:
name: Docs
name: Period
description: Period data type

Comments:
Thanks @scioccha
Unit Test: Construction of DataFrame works with empty list but not empty array
State: closed

- [ ] closes #46822 
- [ ] [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: Error Reporting
description: Incorrect or improved errors from pandas
name: Constructors
description: Series/DataFrame/Index/pd.array Constructors

Comments:
thanks @weikhor
BUG: groupby does not respect dropna=False when input has MultiIndex
State: closed

- [x] closes #46783 (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: Groupby
name: Missing-data
description: np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate

Comments:
nice @rhshadrach
DOC: Add to docs on group_keys in groupby.apply
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
- [x] 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: Groupby
name: Apply
description: Apply, Aggregate, Transform, Map

Comments:
Thanks @rhshadrach (failure unrelated)
[CLN] call __finalize__ in quantile
State: closed

- [x] [Tests added and passed]
- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).

In reference to #28283, this PR intends to ensure that `__finalize__` is always called before returning the result of `DataFrame.quantile`.

This was already the case though, because `__finalize__` is already called explicitly wherever necessary. Furthermore, my previous PR #46101 fixed the remaining problem with metadata propagation in `quantile` as that was caused by `.iloc`.

There remained one return statement with no call to finalize. This code is unreachable though and now removed. The check `if is_list_like(q):` is guaranteed to be true because a few lines up `q = Index(...)` and `Index` is list-like.

Additionally, I have added one more test to increase the coverage of the finalize tests in quantile.

(In case I am wrong and `Index` is not guaranteed to always be list-like, I'll add this code back and add the missing finalize call instead.)

Labels:
name: Clean
name: metadata
description: _metadata, .attrs

Comments:
Thanks @theOehrly (failure was unrelated)
CI: Versioneer not picking up version in 32-bit build
State: closed

- [ ] xref #46856 (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: Build
description: Library building on various platforms
name: CI
description: Continuous Integration

Comments:
@github-actions pre-commit
Thanks @lithomas1