BrandonFors/pandas-github-issues huggingface dataset:
Fix .isin Considers "1" and 1 equal
State: closed

- [X ] ref #34125
- [X ] tests added / passed
- [X ] passes `black pandas`
- [X ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry

Labels:
name: Testing
description: pandas testing functions or related to the test suite
name: Dtype Conversions
description: Unexpected or buggy dtype conversions

Comments:
thanks @gabrielvf1 
So this one just has the tests, but the bug is still present on master?
> So this one just has the tests, but the bug is still present on master?

Yes, I tried to solve but the way I made it was not right enough
REF: Implement RelativeDeltaOffset
State: closed

RelativeDeltaOffset (basically the same as the existing DateOffset class) is a bit of an odd duck _attributes-wise, this is just a move without yet cdef-ing it.

Labels:
name: Frequency
description: DateOffsets

Comments:
hmm can you rebase after all of the merges. maybe ABCTimestamp -> _Timestamp as needed.
Rebased+green
true-green
once more rebase i think these were back of queue
rebased+green
DOC: Clarify ExcelFile's available engine compatibility with file types in...
State: closed

information about engine compatibility and also reflect the support of the pyxlsb engine. GH34237.

DOC: I edited the available ExcelFile's docstring to add information about the recent pyxlsb engine. I also added some compatibility information between the available engines and file types.


- [x] closes #34237
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry


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

Comments:
The failing checks are not related to my changes. Any feedback on how I should proceed?
@miguelmarques1904 fixed in https://github.com/pandas-dev/pandas/pull/34258. Merge master and push again.
@TomAugspurger could you review it? The PR only has documentation improvements, fixing #34237.
thanks @miguelmarques1904
Allow merge_asof on first column of like-levelled MultiIndexes
State: closed

This change essentially allows you to merge_asof on the first level of a MultiIndex, treating the levels after the first as additional 'by' columns. It is possible to do the reset_index/set_index oneself but I think this is a nice syntax and a fairly natural thing to do. Would you be interested in incorporating something like this into pandas?

- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry


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

Comments:
thanks for the PR, could you also create an issue with brief description of the problem? or refer to an existing issue? @tmct 
Can you provide use cases for this?
Make option_context a ContextDecorator.
State: closed

This makes it possible to use option_context as a decorator over an
entire function, saving an indent level and making it easy to comment
out (or in) the context while keeping correct indentation.

- [ ] closes #xxxx (N/A)
- [X] tests added / passed
- [X] passes `black pandas`
- [X] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [X] whatsnew entry


Labels:
name: API Design

Comments:
Can you merge master and repush? Should get CI green
done
thanks @anntzer
BUG: NaT+Period doesnt match Period+NaT
State: closed

- [ ] closes #xxxx
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry

Most of the edits in `__add__` and `__sub__` are just an un-indent to get rid of an unreachable branch, but found this incorrect case along the way.

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

Comments:
thanks, can you add a whatsnew in followon
BUG: Fix validation script not printing docstring is correct (#34228)
State: closed

- [x] closes #34228 
- [ ] tests added / passed
- [x] passes `black pandas`
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry


Labels:
name: Docs

Comments:
Looks reasonable - @datapythonista 
Good call @datapythonista 

I only tested with a correct docstring when I made the change. I've now tested one with errors as well and it seems to work as expected
Thanks for the fix @rtm010
ENH: Implement xlabel and ylabel options in Series.plot and DataFrame.plot
State: closed

- [x] closes #9093
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry


Labels:
name: Enhancement
name: Visualization
description: plotting

Comments:
Hello @charlesdong1991! 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 2020-06-25 15:57:49 UTC
maybe @WillAyd @jreback for a look?
@WillAyd thanks for reviews, and changes are made accordingly

cc @jreback 
some further reviews are very appreciated! @jreback 
thanks for the review, @jreback , done! updated in `visualization.rst` and with an existing df used there as example.


done. any further feedbacks are welcome! 

cc @jreback @WillAyd @datapythonista 
@datapythonista pls merge if good
Thanks @charlesdong1991, nice PR.
BUG: repr of Categorical does not distinguish int and str.
State: closed

- [x] closes #33676
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry


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

Comments:
Does this have impact on the Series repr, or is only for the Categorical (the array) repr?
Should only be for the categorical repr, will update accordingly
lgtm ex a question.
thanks @MarcoGorelli very nice
BUG: Summing a sparse boolean series raises TypeError
State: closed

- [ ] closes #25777
- [ ] tests added / passed
- [ ] passes `black pandas`
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry


Labels:
name: Bug
name: Sparse
description: Sparse Data Type

Comments:
thanks!
BUG: Executing SQL containing non-escaped percent sign fails without parameters
State: closed

- [x] closes https://github.com/pandas-dev/pandas/issues/34211
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry


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

Comments:
Thanks @john-bodley for the PR. can you add a note to doc\source\whatsnew\v1.1.0.rst. Does this also close #11896?
@simonjayhawkins I added the node per your request. Also per https://github.com/pandas-dev/pandas/issues/34211#issuecomment-629831983 I'm uncertain whether this closes https://github.com/pandas-dev/pandas/issues/11896.
> I'm uncertain whether this closes #11896

If you're open to it @john-bodley, maybe you could add a unit test for #11896 to see if it passes out CI. Then we could close that issue 
@mroeschke it seems that this PR doesn't resolve https://github.com/pandas-dev/pandas/issues/11896 for PostgreSQL per the following CI error ([job](https://travis-ci.org/github/pandas-dev/pandas/jobs/688918383)) when I added a unit test:

```
self = <sqlalchemy.dialects.postgresql.psycopg2.PGDialect_psycopg2 object at 0x7f7a36467828>
cursor = <cursor object at 0x7f7a375b4e58; closed: -1>
statement = 'INSERT INTO test_frame1 (index, "%%A") VALUES (%(index)s, %(%A)s)'
parameters = {'%A': 1, 'index': 0}
context = <sqlalchemy.dialects.postgresql.psycopg2.PGExecutionContext_psycopg2 object at 0x7f7a363fc5c0>
    def do_execute(self, cursor, statement, parameters, context=None):
>       cursor.execute(statement, parameters)
E       psycopg2.ProgrammingError: incomplete placeholder: '%(' without ')'
```
Thanks for checking @john-bodley. Your PR looks good otherwise 
Looks like some test failures - @john-bodley can you take a look?
@john-bodley can you fix merge conflict?
@WillAyd done.
Awesome - thanks for the great PR @john-bodley
BUG: DataFrame with Int64 columns casts to float64 with .max()/.min()
State: closed

- [ ] closes #32651
- [ ] tests added / passed
- [ ] passes `black pandas`
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry


Labels:
name: Bug
name: NA - MaskedArrays
description: Related to pd.NA and nullable extension arrays

Comments:
It looks like #25777 needs to be fixed first, so closing to clear queue.
@jorisvandenbossche @jreback This PR in the current state would close #32651 

BUT the issue would persist for DataFrames with non-numeric columns.

I see the benefit of the changes here is consistency of the code path taken regardless of numeric_only parameter for numeric only DataFrames. I can't find an issue for this, but could potentially concoct one.

There is overlap here with #32867 and #32867 would likely close #32651 anyway.

I'll leave this as draft for now, or could close to clear queue if preferred.

in the meantime, I assume investigating #21020 would also benefit #32867.

There's also an issue with PeriodArray raising `TypeError: mean is not implemented for PeriodArray since the meaning is ambiguous` when dispatching to the EA which is currently ignored with DataFrame.mean containing Period column that I could also look into.

```
>>> df = pd.DataFrame(
...     {
...         "A": np.arange(3),
...         "B": pd.date_range("2016-01-01", periods=3),
...         "C": pd.timedelta_range("1D", periods=3),
...         "D": pd.period_range("2016", periods=3, freq="A"),
...     }
... )
>>> df.mean()
<stdin>:1: FutureWarning: DataFrame.mean and DataFrame.median with numeric_only=None will include datetime64 and datetime64tz columns in a futu
re version.
A                  1
C    2 days 00:00:00
dtype: object
>>>
```

I guess we want to maintain the same behaviour.  or is inconsistent behaviour not desirable.

```
>>> df = pd.DataFrame(
...     {
...         "D": pd.period_range("2016", periods=3, freq="A"),
...     }
... )
>>>
>>> df.mean()
Series([], dtype: float64)
>>>
>>> df.D.mean()
Traceback (most recent call last):
...
TypeError: mean is not implemented for PeriodArray since the meaning is ambiguous.  An alternative is obj.to_timestamp(how='start').mean()
>>>
```
 
I just wanted to comment that this overlaps with https://github.com/pandas-dev/pandas/pull/32867, as you also just mentioned. 

Regarding mean of periods, see also https://github.com/pandas-dev/pandas/pull/33758
can you merge master and update to comments
I think we should rather fix this in #32867 (the test could still be useful though, so that could be merged here as an xfail, or I can move it to that PR)
> I think we should rather fix this in #32867 (the test could still be useful though, so that could be merged here as an xfail, or I can move it to that PR)

closing in favour of #32867
Eliminated the skipna / dropna inconsistency in the docs.
State: closed



As @bf mentioned in the comments under the  issue #34063 ,
There are errors in the docs for Dataframe.mode, https://pandas.pydata.org/pandasdocs/dev/reference/api/pandas.DataFrame.mode.html (See source : https://github.com/pandas-dev/pandas/blob/master/pandas/core/frame.py#L8722-L8807) , where the dropna parameter (which occurs more number of times than skipna) has been named skipna (first occurrence on line 8370).  

Labels:

Comments:
Thanks @ashwinpn 

Changing all `skipna`s to `dropna`s would be a pretty big API change, are you sure it would be worth it?
@MarcoGorelli yes, you are correct - That is why I have currently kept this as a draft, it might not be worth it. 
Thanks for the PR. In theory I think there are cases where these would signal distinct functionality though there are other functions where they overlap and maybe could be aligned.However, this isn't something we would just change outright - would need to go through a deprecation cycle first for any changes. 

I think if something you want to pursue its worth starting with an issue and discussion before a PR. We would need to align further on goal and functions where maybe this makes sense
TYP: add return types to read_sql|read_sql_query|read_sql_table
State: closed

Adds return types to read_sql|read_sql_query|read_sql_table.

I'd like to take on the other pd.read_* functions in follow-ups.

Labels:
name: Typing
description: type annotations, mypy/pyright type checking

Comments:
Yeah, that was a mistake. I've updated.
Thanks @topper-123
REF: move get_freq_group to libfreqs, de-duplicate with Resolution.get_freq_group
State: closed

Having both libresolution.get_freq_group and libresolution.Resolution.get_freq_group is confusing, this adds 1 line to the module-level function to make it handle the method, removes the method, and moves the function to libfrequencies, which is a better fit.

Labels:
name: Refactor
description: Internal refactoring of code
name: Frequency
description: DateOffsets

Comments:
can you rebase
rebased+green
ENH: Implement __iter__ for Rolling and Expanding
State: closed

- [x] closes #11704
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry


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

Comments:
Hello @charlesdong1991! 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 2020-05-17 08:43:55 UTC
Could you also test:

- rolling with an offset: `1D`
- where `on` is specified
@mroeschke thanks, I added those two cases of tests, and any further feedbacks are very welcome!
thanks @charlesdong1991 very nice!
In which pandas version it will appear?

The `pandas-1.04` still shows `NotImplementedError`
1.1 which should come out in a few months
CLN: let Index use general concat machinery - remove Index._concat_same_dtype
State: closed

Following up on the recent changes in the `concat_compat` machinery (to use the `_get_common_dtype` protocol for EAs), we can also use this in the Index class. 

Doing this also makes the `_concat_same_dtype` method unnecessary (as this is handled in `concat_compat` to use `EA._concat_same_type` when appropriate)

cc @jbrockmendel 

Labels:
name: Clean
name: Index
description: Related to the Index class or subclasses

Comments:
nice cleanup
thanks!
DOC: Add note about columns parameter not relevant for Series in rename_axis()
State: closed

- [x] closes #33564
- [ ] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry


Labels:
name: Docs

Comments:
Thanks @gabsmoreira
DEPR: deprecate Index.__getitem__ with float key
State: closed

See #34191 for motivation

Closes #34191

Labels:
name: Deprecate
description: Functionality to remove in pandas
name: Index
description: Related to the Index class or subclasses

Comments:
looks good, does this close #34191?

can you add a linkin the deprecations removal issue (2.0)
few comments, generally looks good
> can you add a linkin the deprecations removal issue (2.0)

Added
PERF: Remove unnecessary copies in sorting functions (#33917)
State: closed

- [x] closes #33917
- [x] tests passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry

This PR fixes pereformance regression after commit `dec736f3f` by removing unnecessary copies if `key=None` in sorting functions.

```
setup = """
import pandas as pd
import numpy as np
N = 10 ** 5
idx = pd.date_range(start="1/1/2000", periods=N, freq="s")
s = pd.Series(np.random.randn(N), index=idx)
"""

import timeit
timeit.timeit("s.sort_index()",setup=setup, number=100000)

# master
# 41.245621485984884
# now
# 14.826273362035863
```

Labels:
name: Performance
description: Memory or execution speed performance
name: Reshaping
description: Concat, Merge/Join, Stack/Unstack, Explode

Comments:
Hello @mproszewska! 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 2020-06-03 01:25:38 UTC
> also in tests where this is hit, can you assert that values is not modified

This is used in function that sorts series by index, so I believe that values=index will be modified
Can you add a release note stating that we fixed the performance regression in sort_index?
> Can you add a release note stating that we fixed the performance regression in sort_index?

Should I add note even though regression was in 1.1?
> > Can you add a release note stating that we fixed the performance regression in sort_index?
> 
> Should I add note even though regression was in 1.1?

no this is fine (just add the asvs)
> > > Can you add a release note stating that we fixed the performance regression in sort_index?
> > 
> > 
> > Should I add note even though regression was in 1.1?
> 
> no this is fine (just add the asvs)

Isn't `timeseries.SortIndex.time_sort_index` enough?
what does it show pls post a run 
```
     <perf>           <master>  
+        158±50μs         367±30μs     2.32  timeseries.SortIndex.time_sort_index(True)
+      3.84±0.4ms       5.94±0.5ms     1.55  timeseries.DatetimeAccessor.time_dt_accessor_normalize(None)
-      3.31±0.1ms       2.47±0.3ms     0.75  timeseries.ResampleDataFrame.time_method('max')
```
> looks fine
> 
> can u merge master and ping on green

ping
thanks @mproszewska
TST: add explicit csr explicit zero tests for GH28992
State: closed

simple test case to check that explicitly setting a value to zero in a matrix with csr representation does not cause other values to change, specifically to be set to zero erroneously

- [ ] closes #xxxx
- [*] tests added / passed
- [ ] passes `black pandas`
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry


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

Comments:
@bakitybacon if you can fix up the linting issues & merge master, pls ping on green.
can u merge master and ping on green
Thanks @bakitybacon for the PR. closing as stale.
CLN/TST: Remove Base Class and all subclasses and fixturize data
State: closed

- [x] closes #30486

This PR will be able to finally close 30486 in my opinion (even a little beyond the scope ^^), and after this, all classes adhered to Base in `tests/window` folder is removed.

Although the PR is huge, it actually is quite simple, basically it does:
1. Turn needed data from `_create_data()` in `Base` class as fixtures
2. Remove Base class
3. Change the shared methods which need to inherit data from Base class to use arguments, and in the real tests, assign corresponding fixtures to those arguments accordingly.
4. Remove all sub-classes which inherit from Base class, and now they all turn to independent test functions.

cc @jreback 

And there is no test missing or added, so number of tests remain unchanged for all:
This is the result after i did a quick run for all changed tests to check the number of tests:
```
test_api: 15
test_ewm: 6
test_expanding: 21
test_rolling: 150
test_window: 23
test_moments_ewm: 22
test_moments_rolling: 253
test_moments_consitency_ewm: 4310
test_moments_consistenty_expanding: 1340
test_moments_consistency_rolling: 10881
```


Labels:
name: Testing
description: pandas testing functions or related to the test suite
name: Window
description: rolling, ewma, expanding

Comments:
Hello @charlesdong1991! 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 2020-05-15 09:02:26 UTC
thanks @charlesdong1991 tremendous job!
PERF: avoid creating numpy array in groupby.first|last
State: closed

A unneeded numpy array is created for each group when calling ``groupby.first`` and ``groupby.last`` on ExtensionArrays. This avoids that.

```python
>>> cat = pd.Categorical(["a"] * 1_000_000 + ["b"] * 1_000_000)
>>> ser = pd.Series(cat)
>>> %timeit ser.groupby(cat).first()
210 ms ± 3.03 ms per loop  # master
78.4 ms ± 766 µs per loop  # this PR
```

The same speedup is archieved for ``groupby.last``. The above is 3x faster than in master because there are two groups == we save creating two arrays. If there were more groups/larger arrays, we'd get even more improvements.

Also adds some type hints to help understand what parameters these funtions accept.

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

Comments:
thanks @topper-123 very nice
Update test_period_range.py
State: closed

Attempting to implement test for resolved issue #21793

- [x] closes #21793

Labels:
name: Testing
description: pandas testing functions or related to the test suite
name: Period
description: Period data type
name: Index
description: Related to the Index class or subclasses

Comments:
Hello @jnecus! 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 2020-05-15 09:07:12 UTC
thanks @jnecus
Backport PR #33645, #33632 and #34087 on branch 1.0.x
State: closed

xref #33645, #33632 and #34087

fix test_s3_roundtrip failure on branch 1.0.x https://dev.azure.com/pandas-dev/pandas/_build/results?buildId=35271&view=logs&j=98c84d08-34d8-513e-80be-2c581992dd5a&t=f75024c1-aff0-57fb-4f0e-35923b654e09

Labels:
name: CI
description: Continuous Integration
name: IO Parquet
description: parquet, feather

Comments:
green here so backporting. The changes here could be considered too significant for a backport.

I see the simpler alternative here as maybe just skipping the failing test. so would be happy to revert is others agree.

this is fine to backport
DEPR: DateOffset.__call__
State: closed

- [ ] closes #xxxx
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry


Labels:
name: Frequency
description: DateOffsets
name: Deprecate
description: Functionality to remove in pandas

Comments:
Is there an issue about this?
> Is there an issue about this?

No
can you add this to the deprecation removal list as well
> can you add this to the deprecation removal list as well

added
Can you then at least give a reasoning?
> Can you then at least give a reasoning?

Because its entirely redundant.
Thank you. It would be helpful if you can sometimes just give a bit more explanation when opening a PR (you know, I can't read your mind ;))
> Thank you. It would be helpful if you can sometimes just give a bit more explanation when opening a PR (you know, I can't read your mind ;))

I'll keep that in mind.  Thanks for keeping me honest.
TST: Added test for json containing the key "last_status_change_at"
State: closed


- [x] closes #32409
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry


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

Comments:
@rivera-fernando can you merge master and respond to comments
closing as stale