BrandonFors/pandas-github-issues huggingface dataset:
Updated series documentation to close #35406
State: closed

- [x ] closes #35406
- [x ] tests added / passed
- [ x] passes `black pandas`
- [ x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry

Not sure how to do whatsnew entry for this - first contribution! Do let me know how to improve.

Output of scripts/validate_docstring.py: 
```
################################################################################
########################## Docstring (pandas.Series)  ##########################
################################################################################

One-dimensional ndarray with axis labels (including time series).

Labels need not be unique but must be a hashable type. The object
supports both integer- and label-based indexing and provides a host of
methods for performing operations involving the index. Statistical
methods from ndarray have been overridden to automatically exclude
missing data (currently represented as NaN).

Operations between Series (+, -, /, *, **) align values based on their
associated index values-- they need not be the same length. The result
index will be the sorted union of the two indexes.

Parameters
----------
data : array-like, Iterable, dict, or scalar value
    Contains data stored in Series.

    .. versionchanged:: 0.23.0
       If data is a dict, argument order is maintained for Python 3.6
       and later.

index : array-like or Index (1d)
    Values must be hashable and have the same length as `data`.
    Non-unique index values are allowed. Will default to
    RangeIndex (0, 1, 2, ..., n) if not provided. If data is dict-like
    and index is None, then the values in the index are used to
    reindex the Series after it is created using the keys in the data.
dtype : str, numpy.dtype, or ExtensionDtype, optional
    Data type for the output Series. If not specified, this will be
    inferred from `data`.
    See the :ref:`user guide <basics.dtypes>` for more usages.
name : str, optional
    The name to give to the Series.
copy : bool, default False
    Copy input data.

################################################################################
################################## Validation ##################################
################################################################################

3 Errors found:
        Parameters {'fastpath'} not documented
        See Also section not found
        No examples section found
```

Labels:
name: Docs
name: Series
description: Series data structure
name: Constructors
description: Series/DataFrame/Index/pd.array Constructors

Comments:
cc @TomAugspurger 
Thanks!
BUG: shows correct package name when import_optional_dependency is ca…
State: closed

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


Labels:
name: Build
description: Library building on various platforms
name: Error Reporting
description: Incorrect or improved errors from pandas
name: IO Excel
description: read_excel, to_excel

Comments:
lgtm ping on green
@jreback All checks are green!
@jreback Could you please help me to figure out why the Travis CI build is failing? The test that seems to be failing is pandas/tests/io/test_gcs.py::test_to_csv_compression_encoding_gcs, but due to an assertion error unrelated to my commit. This test was added in via commit 361166f86da1a665a1b5808e0935c28f8cf56d34
I've restarted travis to see if failure persists.
will be merging and backporting if green
@simonjayhawkins The Travis CI build passed this time. Thanks for your help.
Thanks @hs2361 
@meeseeksdev backport 1.1.x
Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

1. Checkout backport branch and update it.

```
$ git checkout 1.1.x
$ git pull
```

2. Cherry pick the first parent branch of the this PR on top of the older branch:
```
$ git cherry-pick -m1 b9a97691de3e85771d84e786ff40351260a5cfcc
```

3. You will likely have some merge/cherry-pick conflict here, fix them and commit:

```
$ git commit -am 'Backport PR #36134: BUG: shows correct package name when import_optional_dependency is ca…'
```

4. Push to a named branch :

```
git push YOURFORK 1.1.x:auto-backport-of-pr-36134-on-1.1.x
```

5. Create a PR against branch 1.1.x, I would have named this PR:

> "Backport PR #36134 on branch 1.1.x"

And apply the correct labels and milestones.

Congratulation you did some good work ! Hopefully your backport PR will be tested by the continuous integration and merged soon!

If these instruction are inaccurate, feel free to [suggest an improvement](https://github.com/MeeseeksBox/MeeseeksDev).
                
maybe due to release notes out of sync https://github.com/pandas-dev/pandas/issues/35831#issuecomment-688174481

i'll resolve that and then see if the backport can be triggered a second time.
@meeseeksdev backport 1.1.x
@meeseeksdev backport 1.1.x
DOC: add missing data handling info to pd.Categorical docstring
State: closed

- [x] closes #35162 
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`

Labels:
name: Docs
name: Categorical
description: Categorical Data Type

Comments:
looks fine. @TomAugspurger @jorisvandenbossche if any comments.
Thanks.
Bug 29764 groupby loses index name sometimes
State: closed

- [x] closes #29764
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry´

Issue was fixed for sum and any with c9144ca54dcc924995acae3d9dcb890a5802d7c0.

So the only thing left was to add the index name in `_wrap_transformed_output`. I kept the tests from #33111, to show, that alle cases are now handled correctly.

I hope it is okay, to add a new PR for this?

Labels:
name: Bug
name: Groupby

Comments:
thanks @phofl very nice
REGR: ensure closed attribute of IntervalIndex is preserved in pickle roundtrip
State: closed

Closes #35658

cc @jbrockmendel 

(I suppose the long term way would rather to properly pickle the IntervalArray itself and restore from that, instead of restoring from the left/right arrays, but would rather leave such a change for 1.2)

Labels:
name: Regression
description: Functionality that used to work in a prior pandas version
name: Interval
description: Interval data type
name: IO Pickle
description: read_pickle, to_pickle

Comments:
thanks @jorisvandenbossche 
@meeseeksdev backport 1.1.x
REGR: append tz-aware DataFrame with tz-naive values
State: closed

Closes #35460


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

Comments:
cc @simonjayhawkins 
> #[error]doc/source/whatsnew/v1.1.2.rst:19:- Fix regression in :meth:`DataFrame.append` mixing tz-aware and tz-naive datetime columns (:issue:`35460`)  <- trailing whitespaces found


thanks @jorisvandenbossche 
@meeseeksdev backport 1.1.x
REGR: fix consolidation/cache issue with take operation
State: closed

Closes #35521


@jbrockmendel the "short term" fix for 1.1.2

Labels:
name: Indexing
description: Related to indexing on series/frames, not to indexes themselves
name: Regression
description: Functionality that used to work in a prior pandas version

Comments:
The non-copying alternative would be to not call `self._consolidate_inplace` in `BlockManager.take`
LGTM; can look into the no-copy solution longer-term
thanks!
@MeeseeksDev backport to 1.1.x
CLN: use IS64 instead of is_platform_32bit #36108
State: closed

- [x] closes #36108
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`



Labels:
name: Clean
name: 32bit
description: 32-bit systems

Comments:
thanks @VirosaLi very nice
BUG: DataFrame.any with axis=1 and bool_only=True
State: closed

- [x] closes #32432
- [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: Algos
description: Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff

Comments:
@jreback gentle ping; there are two other DataFrame._reduce-related PRs that are somewhat tough, this one should be easy.  getting it out of the way might make the others marginally easier.
DEPR: making copies when indexing along columns
State: closed

- [x] closes #33780
- [ ] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry

xref #33597 for what this might look like once the deprecation is enforced (nice perf bump)

cc @jorisvandenbossche my understanding is that we will need this deprecation for the all-1D world too.  Is that correct?  Any thoughts on nice ways to test this and avoid putting tm.assert_produces_warning in a zillion places across the code?


Labels:

Comments:
> my understanding is that we will need this deprecation for the all-1D world too. Is that correct?

We don't *have* to (I mean it's not tied to being 1D), but yes, I suppose we will want that to return views in the long term (although there wasn't much discussion around it in the issue). 

> Any thoughts on nice ways to test this and avoid putting tm.assert_produces_warning in a zillion places across the code?

This also indicates that users will see a zillion of such warnings .. Also, what is the way for users to silence the warning? 
So therefore, I am not really sure we should already start doing that now. Certainly because in many cases it won't actually matter for their code. The other option is to "simply" make a breaking change for pandas 2.0.
> The other option is to "simply" make a breaking change for pandas 2.0

Is there precedent for this?  Per #33597, I'm OK with just making the switch immediately.

> This also indicates that users will see a zillion of such warnings .. Also, what is the way for users to silence the warning?

Good question.  I guess we'd have to give a way to opt in to the always-view behavior, or maybe a global flag to silence the warning.  Neither is particularly pretty.
What do you mean with precedent? (what kind of precedent are you looking for in this case?)
> What do you mean with precedent? (what kind of precedent are you looking for in this case?)

Changes that _would_ require a deprecation cycle being made without one
Ah, we certainly have that ;) Check the sections "Backwards incompatible API changes" in all previous releases?  
makes sense, thanks
CLN removing trailing commas
State: closed

This PR is related to #35925, both current and new versions of black passes these formatting,
also I'd like to mention  that there seem to be a reported [bug](https://github.com/psf/black/issues/1629) in newer version of black which throws error after removing trailing comma from  `pandas/tests/scalar/timestamp/test_constructors.py` that's why I didn't change this formatting.
```diff
      diff --git a/pandas/tests/scalar/timestamp/test_constructors.py b/pandas/tests/scalar/timestamp/test_constructors.py
index 316a299ba..c70eacdfa 100644
--- a/pandas/tests/scalar/timestamp/test_constructors.py
+++ b/pandas/tests/scalar/timestamp/test_constructors.py
@@ -267,7 +267,7 @@ class TestTimestampConstructors:
                 hour=1,
                 minute=2,
                 second=3,
-                microsecond=999999,
+                microsecond=999999
             )
         ) == repr(Timestamp("2015-11-12 01:02:03.999999"))
 
~
```
The workaround to this is after removing trailing comma from above code run black with --fast which will add trailing comma back again and and will not format afterwards on re-running black without --fast

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

Comments:
Thanks for looking into this, I remember getting some errors when running the new version of black on all the files
Can you merge master to get the CI green please?
> Can you merge master to get the CI green please?

@MarcoGorelli I was wondering why CI isn't passing, I'll merge it.
Thanks
Thanks @sarthakchaudhary13
TYP: misc fixes for numpy types 3
State: closed

```
pandas\core\reshape\merge.py:1931: error: Incompatible types in assignment (expression has type "ndarray", variable has type "ExtensionArray")  [assignment]
pandas\core\reshape\merge.py:1932: error: Incompatible types in assignment (expression has type "ndarray", variable has type "ExtensionArray")  [assignment]
pandas\core\reshape\merge.py:1941: error: Incompatible types in assignment (expression has type "ndarray", variable has type "ExtensionArray")  [assignment]
pandas\core\reshape\merge.py:1950: error: Incompatible types in assignment (expression has type "ndarray", variable has type "ExtensionArray")  [assignment]
pandas\core\reshape\merge.py:1951: error: Incompatible types in assignment (expression has type "ndarray", variable has type "ExtensionArray")  [assignment]
pandas\io\pytables.py:5084: error: Incompatible types in assignment (expression has type "ndarray", variable has type "ExtensionArray")  [assignment]
```

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

Comments:
pls rebase
closing to clear queue. (also need a decision on naming)
TYP: misc fixes for numpy types 2
State: closed

```
pandas\core\dtypes\cast.py:681: error: Incompatible types in assignment (expression has type "DatetimeTZDtype", variable has type "dtype")  [assignment]
pandas\core\dtypes\cast.py:715: error: Incompatible types in assignment (expression has type "IntervalDtype", variable has type "dtype")  [assignment]
pandas\core\dtypes\common.py:1392: error: Item "dtype" of "Union[dtype, ExtensionDtype]" has no attribute "_is_boolean"  [union-attr]
pandas\core\dtypes\common.py:111: error: Function "numpy.array" is not valid as a type  [valid-type]
pandas\core\reshape\merge.py:1873: error: Function "numpy.array" is not valid as a type  [valid-type]
```

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

Comments:
thanks @simonjayhawkins
TYP: misc fixes for numpy types
State: closed

```
pandas/core/dtypes/cast.py:1491: error: Incompatible return value type (got "Type[object]", expected "Union[dtype, ExtensionDtype]")  [return-value]
pandas/core/dtypes/cast.py:1553: error: Incompatible types in assignment (expression has type "Type[object]", variable has type "Union[dtype, ExtensionDtype]")  [assignment]
pandas/core/construction.py:601: error: Incompatible default for argument "dtype_if_empty" (default has type "Type[object]", argument has type "Union[ExtensionDtype, str, dtype, Type[str], Type[float], Type[int], Type[complex], Type[bool]]")  [assignment]
pandas/core/generic.py:6217: error: Argument "dtype_if_empty" to "create_series_with_explicit_dtype" has incompatible type "Type[object]"; expected "Union[ExtensionDtype, str, dtype, Type[str], Type[float], Type[int], Type[complex], Type[bool]]"  [arg-type]
pandas/tests/arrays/sparse/test_dtype.py:97: error: Argument 1 to "SparseDtype" has incompatible type "Type[object]"; expected "Union[ExtensionDtype, str, dtype, Type[str], Type[float], Type[int], Type[complex], Type[bool]]"  [arg-type]
pandas/tests/arrays/sparse/test_dtype.py:172: error: Argument 1 to "SparseDtype" has incompatible type "Type[object]"; expected "Union[ExtensionDtype, str, dtype, Type[str], Type[float], Type[int], Type[complex], Type[bool]]"  [arg-type]
pandas/tests/arrays/sparse/test_combine_concat.py:44: error: Argument 1 to "SparseDtype" has incompatible type "Type[object]"; expected "Union[ExtensionDtype, str, dtype, Type[str], Type[float], Type[int], Type[complex], Type[bool]]"  [arg-type]
pandas/tests/arrays/sparse/test_array.py:561: error: Argument 1 to "SparseDtype" has incompatible type "Type[object]"; expected "Union[ExtensionDtype, str, dtype, Type[str], Type[float], Type[int], Type[complex], Type[bool]]"  [arg-type]
```

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

Comments:
@jbrockmendel good here?
all good
Center window
State: closed

- [x] closes #20012
- [ ] tests added / passed
- [ ] passes `black pandas`
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry

Added center functionality for `VariableWindowIndexer`. Note - I am unsure if the NotImplementedError in lines 1966-1969 in rolling.py still correctly raises an error for offset based windows.

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

Comments:
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.
Closing for now. @adamamiller ping whenever you'd like to continue and we'll reopen!
Would love to see this functionality and would like to pick up the pull request with @luholgit

What are the next required steps?

We already forked the pandas repo and checked out the branch from @adamamiller.

However, when trying to update the branch by pulling from origin/master into fork/center_window we encountered several merge conflicts which we are not sure how to solve.

Should we solve them based on our understanding and then discuss those changes in this PR?




@jreback and @arw2019, mentioning you explicitly as we need this change urgently and would love to implement at the open source directly as opposed to our private repository! :)
you see the comments above

this needs to have master merged and needs tests 
Thanks for your quick response, we are implementing the merge and tests right now.

(Un)Fortunately, we were not able to push to @adamamiller's fork. 

Could you change the pull request to come from https://github.com/luholgit/pandas/tree/center_window?

Or shall we create a new issue such that the new source branch from our fork is selected automatically?
@Zaubeerer thanks for taking this forwards - you can open a new pull request
@Zaubeerer you just create a new PR, no need to create a new issue
BUG: extra leading space in to_string when index=False
State: closed

- [x] closes #24980 
- [x] tests added / passed
- [ ] passes `black pandas`
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry

This PR is mainly from #29670 contributed by @charlesdong1991, and I made a few changes on his work.
The code have passed all tests modified and added in `test_format.py` and `test_to_latex.py`.
Any comment is welcomed!

Labels:
name: Bug
name: Output-Formatting
description: __repr__ of pandas objects, to_string
name: Regression
description: Functionality that used to work in a prior pandas version

Comments:
Hello @onshek! 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-09-06 02:50:26 UTC
> @onshek nice! this probably needs to be moved to 1.2 whatsnew note?

done
> @onshek since the default has changed from `None` to `True`, maybe nicer to update the docstring a bit as well, something like?
> 
> ```
> # current doc
> leading_space : bool, optional
> 
> # suggested?
> leading_space : bool, optional, default is True
> ```

Sure, working on it.
@jreback @charlesdong1991 Done. Thanks for your reviews :)
thanks @onshek very nice!
BUG: df.replace with numeric values and str to_replace
State: closed

- [x] closes #34789
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry

We also avoid copies by not calling `self.as_array` and instead moving the mask-finding to the block level.

Labels:
name: Algos
description: Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff

Comments:
Looks like we have both a doctest and prose in missing_data.rst saying the current behavior (which this PR calls a bug) is intentional:

```
        Note that when replacing multiple ``bool`` or ``datetime64`` objects,
        the data types in the `to_replace` parameter must match the data
        type of the value being replaced:

        >>> df = pd.DataFrame({'A': [True, False, True], 'B': [False, True, False]})
        >>> df.replace({'a string': 'new value', True: False})  # raises
        Traceback (most recent call last):
            ...
        TypeError: Cannot compare types 'ndarray(dtype=bool)' and 'str'

        This raises a ``TypeError`` because one of the ``dict`` keys is not of
        the correct type for replacement.
```

Under this PR, the example in the doctest returns

```
       A      B
0  False  False
1  False  False
2  False  False
```

which strike me as better behavior.
I don't think the documented behavior is desirable, and I read it as more of a "hey this is a limitation of the replace implementation".

So I'm OK with changing behavior here as a "bugfix with behavior changing implications".
very nice @jbrockmendel +1 on adding array_algos and *using* them from the blocks
PERF: use from __future__ import annotations more
State: closed

xref https://github.com/pandas-dev/pandas/pull/36034#issuecomment-684964511

@WillAyd using `python -X importtime -c "import pandas"` I don't see any different in import time after running a few times and things are cached.

so I don't think we gain anything from a performance POV and therefore only need to use it for stylistic reasons in a few modules and not across the codebase.

I've opened this PR, in case someone wants to test performance with these changes.

so feel free to close


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

Comments:
Rather than do this in every module I think should just do where it actually makes a difference for annotations
yep. that's my conclusion. feel free to close
OK sure - can come back to this if that doesn't work out
Comma cleanup
State: closed

- [x] pandas/tests/indexes/datetimes/test_datetime.py
- [x] pandas/tests/indexes/datetimes/test_timezones.py
- [x] pandas/tests/indexes/multi/test_constructors.py
- [x] pandas/tests/indexes/multi/test_isin.py
- [x] pandas/tests/indexes/test_base.py
- [x] pandas/tests/indexes/timedeltas/test_scalar_compat.py
- [x] pandas/tests/indexes/timedeltas/test_searchsorted.py
- [x] pandas/tests/indexing/common.py
- [x] pandas/tests/indexing/test_callable.py
- [x] pandas/tests/indexing/test_check_indexer.py
- [x] pandas/tests/indexing/test_coercion.py
- [x] pandas/tests/indexing/test_floats.py


Labels:
name: Clean

Comments:
Not sure why I’m getting errors in `Azure Pipelines / pandas-dev.pandas (Windows py37_np16)`. Any advice on how to resolve these?
This latest commit passed the Azure checks, but for some reason now fails on the typing validation checks.
> This latest commit passed the Azure checks, but for some reason now fails on the typing validation checks.

unrelated, xref #36085
Thanks @JonathanShrek - can you fetch and merge upstream/master and push to get the CI checks green please?
Thanks @simonjayhawkins I’ll push another commit tonight.
@MarcoGorelli I’ll do that tonight. Thanks for the help!
Yeah I can do this @MarcoGorelli. I actually noticed all of the other files that had already been merged in the diffs as well, but wasn’t sure how to fix it and nobody had said anything so I was just going with it. I’ll get this done this afternoon. Thanks for the detailed response!
thanks @JonathanShrek