BrandonFors/pandas-github-issues huggingface dataset:
BUG: is_utc(dateutil_utc)
State: closed

- [ ] closes #xxxx
- [x] tests added / passed
- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing.html#code-standards) for how to run them
- [x] whatsnew entry


Labels:
name: Bug
name: Timezones
description: Timezone data dtype

Comments:
can you also add a whatsnew note
> can you also add a whatsnew note

updated+green
odd why the 32-bit build failed: https://dev.azure.com/pandas-dev/pandas/_build/results?buildId=52841&view=logs&j=f39ddbca-85f6-5283-3bfe-05832bcf5208&t=60a5c9af-5075-529a-e870-f4d886d8e7ce
> odd why the 32-bit build failed

 yah ive been seeing that occasionally recently, havent figured out whats going on there

rebased + green
CLN, TYP use string types in generics
State: closed

- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing.html#code-standards) for how to run them


Labels:
name: Code Style
description: Code style, linting, code_checks
name: Typing
description: type annotations, mypy/pyright type checking

Comments:
> We probably need to use a AST parser to do this checking in the longer term.

Agreed - it's in my backlog to make sense of that and to make a better solution (which could be its own package), will get back to you on it when I make progress
> > We probably need to use a AST parser to do this checking in the longer term.
> 
> Agreed - it's in my backlog to make sense of that and to make a better solution (which could be its own package), will get back to you on it when I make progress

I just gave it a go and I think I have something which does the job! Will make a PR tomorrow, we can close this one, thanks for pushing me to do it properly :pray:
CLN: remove pd import in pandas/core/computation
State: closed

- [ ] closes #xxxx
- [ ] tests added / passed
- [ ] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing.html#code-standards) for how to run them
- [ ] whatsnew entry

Remove ``import pandas as pd`` in ``pandas/core/computation``.

Labels:

Comments:
Thanks @ivanovmg
ENH: cast instead of raise for IntervalIndex setops with differnet closed
State: closed

- [ ] closes #xxxx
- [x] tests added / passed
- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing.html#code-standards) for how to run them
- [x] whatsnew entry


Labels:
name: Interval
description: Interval data type
name: Index
description: Related to the Index class or subclasses

Comments:
Ping
BUG: setting dt64 values into Series[int] incorrectly casting dt64->int
State: closed

- [ ] closes #xxxx
- [x] tests added / passed
- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing.html#code-standards) for how to run them
- [x] whatsnew entry


Labels:
name: Bug
name: Indexing
description: Related to indexing on series/frames, not to indexes themselves

Comments:
> sure but i thin it is much more clear to use an elif and then simply repeat that line in the else

ok, will update.

BTW #38709, #39044, #39163 also touch this code, will need to get those merged/rejected in order to move forward on the refactor in #39302.

(and a very gentle ping on #38992 since I want to write more tests)
rebased + green
lgtm. can you merge master and ping on green
CI/STYLE Fix misspellings exposed by codespell
State: closed

- [ ] partial fix for  #38802 
- [ ] tests added / passed
- [ ] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing.html#code-standards) for how to run them
- [ ] whatsnew entry


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

Comments:
Just added the new changes @MarcoGorelli 
thanks @zitorelova
REGR: fix numpy accumulate ufuncs for DataFrame
State: closed

Closes #39259

So we shouldn't call non-`__call__` ufuncs block-by-block, since they can work along a certain axis, like `accumulate`. In this case there were 2 problems: 1) we were applying the ufunc on the Block values, which is 2D but transposed compared to the DataFrame (so the accumulation was done in the wrong direction) and 2) the `axis` keyword was also not passed through in case the user specified it.

Labels:
name: Regression
description: Functionality that used to work in a prior pandas version

Comments:
cc @TomAugspurger 
thanks @jorisvandenbossche 
@meeseeksdev backport 1.2.x
DEPR: astype dt64<->dt64tz
State: closed

- [x] closes #38622
- [x] tests added / passed
- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing.html#code-standards) for how to run them
- [x] whatsnew entry


Labels:
name: Datetime
description: Datetime data dtype
name: Deprecate
description: Functionality to remove in pandas

Comments:
> tested with DTI, Series, DTA? (i think so, just confirming). 

Yes

> do we allow this with Timestamp? (obviously deprecate if we do)

No, there is no Timestamp.astype
great
CLN refactor maybe-castable
State: closed

- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing.html#code-standards) for how to run them

extracted from #37586

Labels:
name: Refactor
description: Internal refactoring of code
name: Dtype Conversions
description: Unexpected or buggy dtype conversions

Comments:
thanks @MarcoGorelli
DOC: keep color for note admonitions in sphinx theme
State: closed

This doesn't change anything about the appearance in the docs, but is meant to keep the current look anticipating a change in the default color in the theme upstream (https://github.com/pandas-dev/pydata-sphinx-theme/pull/281)

Labels:
name: Docs

Comments:
@simonjayhawkins I am going to backport this for 1.2.1, not critical but just to ensure the docs keep looking the same (needed because we are using pydata-sphinx-theme master at the moment, which we should change to a pinned version once it has a new release)
Backport PR #39202 on branch 1.2.x
State: closed


Labels:
name: IO Stata
description: read_stata, to_stata

Comments:
Thanks @twoertwein 1.2.x is on mypy 0.782 so will need a fixup
should be fixed now. Sorry, I didn't see that you were already working on back-porting it!
Thanks @twoertwein
REGR: codecs.open() is always opened in text mode
State: closed

- [x] closes #39247
- [x] tests added / passed
- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing.html#code-standards) for how to run them
- [ ] whatsnew entry


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

Comments:
Thanks @twoertwein for the PR. can you add a release note to 1.2.1 for now. see https://github.com/pandas-dev/pandas/pull/39239#issuecomment-762448465
technically there are cases where `codecs.StreamReaderWriter` is expecting bytes: https://docs.python.org/3/library/codecs.html#binary-transforms but these cases didn't work with <1.2 (and do not work with 1.2).
thanks @twoertwein 
@meeseeksdev backport 1.2.x
@meeseeksdev backport 1.2.x
Something went wrong ... Please have  a look at my logs.
DOC: clean-up of v1.2.1 whatsnew
State: closed

First commit is fixing links to the reference docs (many were not actually working links), the second commit is just a reorder to group related ones together (but together it makes the diff a bit difficult to interpret)

cc @simonjayhawkins 

Labels:
name: Docs

Comments:
Thanks @jorisvandenbossche . also need to move a note that I moved in error https://github.com/pandas-dev/pandas/pull/39233#issuecomment-761900915, do that here?
Will do that here
@jorisvandenbossche merge when ready. `test_coordinates` is flaky
Thanks @jorisvandenbossche
BUG: Timestamp.round floating point error
State: closed

- [ ] closes #xxxx
- [x] tests added / passed
- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing.html#code-standards) for how to run them
- [ ] whatsnew entry

xref #38964 analogous bug in Timedelta (separate PR upcoming)

```
ts = pd.Timestamp.max - pd.Timedelta(304)

>>> ts.ceil("s")
Timestamp('1677-09-21 00:12:43.290448384')
```

Labels:
name: Bug
name: Datetime
description: Datetime data dtype

Comments:
ok lgtm. can you add a whatsnew note.

too bad we can't get numpy to actually check for overflow for us. (or is it possible with https://numpy.org/doc/stable/reference/generated/numpy.seterr.html)?
> too bad we can't get numpy to actually check for overflow for us. (or is it possible with https://numpy.org/doc/stable/reference/generated/numpy.seterr.html)?

AFAICT no.  https://github.com/numpy/numpy/issues/16352
thanks @jbrockmendel
Updated Comparison to Excel documentation with code example of read_excel and to_excel for #38990
State: closed

- This is my first time contributing - please let me know if any other detail is needed! Essentially I just swapped the order of the "Excel" and "CSV" paragraphs in the data importing section, so that the examples given for to_excel and read_excel would flow from the CSV example without needing repeated code/codeblocks.


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

Comments:
Oh, sorry, one other thing: for future commits, make sure to use [these prefixes](https://pandas.pydata.org/docs/dev/development/contributing.html#committing-your-code). I think that can be fixed by whomever merges doing a [squash](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-request-merges#squash-and-merge-your-pull-request-commits), so don't worry about changing it (unless you want to — [instructions](https://docs.github.com/en/github/committing-changes-to-your-project/changing-a-commit-message)).
Thank you Aidan, Jeff - and thank you Aidan for guiding me on my first ever pandas PR! hopefully more to come!
thanks @bsun94
CLN: remove unused axis kwarg from Block.putmask
State: closed

- [ ] closes #xxxx
- [ ] tests added / passed
- [ ] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing.html#code-standards) for how to run them
- [ ] whatsnew entry


Labels:
name: Internals
description: Related to non-user accessible pandas implementation
name: Clean

Comments:
great
Revert "Inconsistent indexes for tick label plotting (#28733)"
State: closed

This reverts commit fb379d8266492f917ed880f7619f3d0d9bc7c8db.

reverts #28733

cc @nrebena @jreback @WillAyd @charlesdong1991

just the complete revert for now for ci testing, will add commits for release notes. will NOT add regression tests see https://github.com/pandas-dev/pandas/issues/38721#issuecomment-761840221

Labels:
name: Visualization
description: plotting

Comments:
thanks @simonjayhawkins 
@meeseeksdev backport 1.2.x
Something went wrong ... Please have  a look at my logs.
DOC: Start v1.2.2 release notes
State: closed


Labels:
name: Docs

Comments:
web and docs will fail until 1.2.1 tag exists (can restart just that job after release)
test failure unrelated

```
=========================== short test summary info ============================
FAILED pandas/tests/io/parser/common/test_chunksize.py::test_warn_if_chunks_have_mismatched_type[python]
= 1 failed, 150003 passed, 3494 skipped, 1077 xfailed, 5 xpassed, 30 warnings in 1563.91s (0:26:03) =
```
BUG: Series.resample fails on NaT index
State: closed

- [x] closes #39227
- [x] tests added / passed
- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing.html#code-standards) for how to run them
- [x] whatsnew entry

This will also resolve the core issue of https://github.com/pandas-dev/pandas/pull/34998#discussion_r556463043. cc @jorisvandenbossche 

The added test:

```
    s = series.copy()
    s.index = PeriodIndex([NaT] * len(s), freq=freq)
    result = getattr(s.resample(freq), resample_method)()
```

currently fails for `freq="M"`, where upsample is used instead of downsample leading to failure since the index is not unique. I can't tell if this is a bug or an operation that should raise. It also fails for `DataFrame`, so I think is unrelated to the issue here.

cc @jbrockmendel 

Labels:
name: Bug
name: Missing-data
description: np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate
name: Resample
description: resample method
name: Series
description: Series data structure

Comments:
thanks @rhshadrach
DOC: Added notes section in dropna method
State: closed

In case of specifying both the optional parameters how and thresh then thresh takes the precedence

- [x] tests added / passed
- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing.html#code-standards) for how to run them
- [x] whatsnew entry

![Screenshot from 2021-01-17 19-12-34](https://user-images.githubusercontent.com/51440666/104845272-7997ec80-58fa-11eb-9d42-5f2d212e440c.png)

Labels:

Comments:
Hello @shubhamsharma10! 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/frame.py`](https://github.com/pandas-dev/pandas/blob/a7013b6977e7a7eccb84bb12ebcd467934c01aaa/pandas/core/frame.py):

> [Line 5160:89](https://github.com/pandas-dev/pandas/blob/a7013b6977e7a7eccb84bb12ebcd467934c01aaa/pandas/core/frame.py#L5160): [E501](https://duckduckgo.com/?q=pep8%20E501) line too long (90 > 88 characters)
ENH: add str.removeprefix
State: closed

- [x] closes #36944
- [ ] tests added / passed
- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing.html#code-standards) for how to run them
- [x] whatsnew entry


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

Comments:
Hello @erfannariman! 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 2021-02-12 22:46:27 UTC
@erfannariman can you merge master and fixup
> @erfannariman can you merge master and fixup

Yes, will do this weekend.
Will also want to add an entry to doc/source/reference/series.rst to make sure this renders in the docs
yep, pls add to here: https://pandas.pydata.org/pandas-docs/dev/user_guide/text.html#method-summary, optionally add add an example near strip
This pull request is stale because it has been open for thirty days with no activity. Please update or respond to this comment if you're still interested in working on this.
@erfannariman can you merge master and get tests to pass. also can you add a benchmark.

Is there a benefit to using the builtin if py39 else using the fallback

and also for the fallback is there any benefit to having two maps followed by a np.where over just using the fallback function (len(prefix) is invariant so the mapper function can be defined in a closure)

This does not close the issue? need to add removesuffix also?

This should also work for StringArray. can you use `any_string_dtype` in the tests
Thanks @erfannariman for the PR. closing as stale. ping if you want to continue.
Revert "CI: Skip numpy dev failing tests (#39090)"
State: closed

This reverts commit 3bd3d1ec

- [x] xref #39205 can close this now probably
- [x] closes #39089 
- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing.html#code-standards) for how to run them



Labels:
name: Dtype Conversions
description: Unexpected or buggy dtype conversions
name: CI
description: Continuous Integration

Comments:
> * [x]  xref #39205 can close this now probably
> *

restarted https://github.com/pandas-dev/pandas/runs/1716733247 to confirm
1.2.x is green, but we have different tests failing here now. Will investigate
Could someone restart numpy dev ci? The failing tests were not touched by this revert and can not reproduce this locally.

failure is always with calls like:

```
df = pd.DataFrame({"A": [1, 2, 3], "B": [4, 5, 6]})
df.A
```

The second line is raising ``AttributeError: 'DataFrame' object has no attribute 'A'`` in this ci run
> The second line is raising `AttributeError: 'DataFrame' object has no attribute 'A'` in this ci run

see that occasionally, first seen around 3rd Jan https://github.com/pandas-dev/pandas/pull/38852#issuecomment-753624791


This seems to have spread compared to the link you've posted. We got a lot of failures in test_merge too. Was someone able to debug this?
> This seems to have spread compared to the link you've posted. We got a lot of failures in test_merge too. Was someone able to debug this?

IIRC locally i had these failures consistently but after the next merge of master resolved. On the couple of occasions i've seen on ci, restarting ci resolved. we'll see what happens here. 
Seems to have worked here too.
I think OK to merge this. the other test failure is also a flaky test which will pass after one or more restarts eg. restarted on #39139 and passed on second attempt.

```
=========================== short test summary info ===========================
FAILED pandas/tests/io/pytables/test_store.py::test_coordinates - AssertionEr...
= 1 failed, 98979 passed, 4748 skipped, 1034 xfailed, 3 xpassed, 82 warnings in 1184.42s (0:19:44) =
```
Thanks @phofl 
Yeah this is an ugly one, I set up a development env on windows a few days ago but could not reproduce this.
BUG: Timestamp comparison with barely-out-of-bounds datetime64
State: closed

- [ ] closes #xxxx
- [x] tests added / passed
- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing.html#code-standards) for how to run them
- [x] whatsnew entry


Labels:
name: Bug
name: Numeric Operations
description: Arithmetic, Comparison, and Logical operations

Comments:
looks needs a rebase and tests are failing
rebased + green
DEPR: EWM.vol
State: closed

- [x] tests added / passed
- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing.html#code-standards) for how to run them
- [x] whatsnew entry

`vol` is undocumented and was just `std` which is more standard in our API

Labels:
name: Deprecate
description: Functionality to remove in pandas
name: Window
description: rolling, ewma, expanding

Comments:
thanks @mroeschke
DOC/REF: Rolling/Expanding/EWM docstrings
State: closed

- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing.html#code-standards) for how to run them


- Create a new `window/doc.py` file for common template
- Using `@doc` decorator instead of `@Appender`
- Standardize descriptions and sections

<img width="1255" alt="Screen Shot 2021-01-16 at 5 06 52 PM" src="https://user-images.githubusercontent.com/10647082/104828385-c7601680-5860-11eb-99b5-e73357719348.png">
 


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

Comments:
cc @jorisvandenbossche @simonjayhawkins if you have any comments
~I might need a precursor PR to align function signatures.~

~@jreback thoughts on all functions having a signature of `def func(*args, <keyword_only_arguments>, **kwargs)`?~

~Though `*args`, `**kwargs` may never be used.~

EDIT: Nevermind
hmm somthing going wrong on the docs build
Fixed the doc build failing tests and all green.

Refactored now to omit empty sections.
ahh can you rebase
cc @simonjayhawkins @jorisvandenbossche if any other comments.
Going to merge and can address any follow ups in another PR
REF: Split up parsers into smaller files
State: closed

- [x] closes #38930
- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing.html#code-standards) for how to run them


Refactored them into 4 files, similar to described in the issue. If this is accepted I will try to clean this up a bit more through unifying the calls a bit


Labels:
name: Refactor
description: Internal refactoring of code
name: IO CSV
description: read_csv, to_csv

Comments:
Thanks, will do that. 

Yes, just moved them around. Will go to refactoring after this
I moved the relevant functions up, I changed the import paths for the helper functions in the test functions
https://github.com/pandas-dev/pandas/pull/39217/checks?check_run_id=1730796224 looks like a real fail
Have to check, this one worked 3 days ago in the pipelines
Hm merged master, let's check if this persists. Can not reproduce this locally
Additionally this worked the commit before when I forgot a few imports. At least a place to start pinning if it persists
Green now

@twoertwein I think you worked with unclosed handles the last few days/weeks? Could you maybe have a look and see if this is familiar?
Failing https://github.com/pandas-dev/pandas/runs/1731152527?check_suite_focus=true too, unrelated here then
> @twoertwein I think you worked with unclosed handles the last few days/weeks? Could you maybe have a look and see if this is familiar?

I assume that most of the ssl warnings come from boto3 (I honestly gave up on them for now in #39047). Wasn't a test like that recently xfailed  (reason s3/boto3 being updated)?
Yes, but this test really failed not only raised a warning,
do you mean the  `OSError: [Errno 98] Address already in use` in `test_server_and_default_headers test`? Is it possible that multiple instances of pytest run on the same machine but they like to use the same port?

or `test_warn_if_chunks_have_mismatched_type`. I think I have looked at this (or a similar) test when working on #39047. As far as I remember, there shouldn't be a need for any "ssl-stuff" in this test. The only resource that might not be closed is `StringIO`. Locally (on linux) I can not re-create most of the ResourceWanrings.
Sorry this was not clear enough by myself. I was talking about ``test_warn_if_chunks_have_mismatched_type``. Have the same issue, can not reproduce locally.
thanks @phofl
API/BUG: treat different UTC tzinfos as equal
State: closed

- [x] closes #23959
- [x] tests added / passed
- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing.html#code-standards) for how to run them
- [ ] whatsnew entry


Labels:
name: Timezones
description: Timezone data dtype

Comments:
> can you add a whatsnew note (bug fix ok).

updated

> any perf diffs here?

tz_compare checks will be slightly slower, but we'll avoid casting to object in a few cases.  not much
TST GH26807 Break up test_strings
State: closed

This PR partially addresses xref #26807 in the case of pandas/tests/test_strings.py. It deletes that file and makes a new subpackage pandas/tests/strings/ with 8 new test modules plus a conftest file. 

I have only moved tests and flattened the structure by moving the tests from being methods to functions -  I haven't changed them in any other way. There are 1814 tests that were in pandas/tests/test_strings.py and are now in pandas/tests/strings/. I tried to keep each test module logically cohesive and less than 1000 lines long - test_strings.py still contains all the tests that don't really fit anywhere else.

- [ ] closes #xxxx
- [ ] tests added / passed
- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing.html#code-standards) for how to run them
- [ ] whatsnew entry


Labels:
name: Testing
description: pandas testing functions or related to the test suite
name: Strings
description: String extension data type and string data

Comments:
thanks @moink