BrandonFors/pandas-github-issues huggingface dataset:
Fix a bunch of docs syntax
State: closed

- [ ] closes #xxxx
- [ ] tests added / passed
- [ ] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit) for how to run them
- [ ] whatsnew entry

From the Sphinx docs (https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#directive-versionadded):

> Note that there must be no blank line between the directive head and the explanation; this is to make these blocks visually continuous in the markup.

Labels:
name: Docs
name: Stale

Comments:
Actually it doesn't seem to make a difference for most of the docs so I reverted most of the changes.
@jonashaag can you merge master and address comments
This pull request is stale because it has been open for thirty days with no activity. Please [update](https://pandas.pydata.org/pandas-docs/stable/development/contributing.html#updating-your-pull-request) and respond to this comment if you're still interested in working on this.
closing as stale (still work take if rebased)
BUG: inconsistency in dtype of replace()
State: closed

- [x] closes #44864 
- [x] tests added / passed
- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit) for how to run them
- [x] whatsnew entry

Prevented direct return of Regex=True allowing the dtype conversion to happen.

Labels:
name: Reshaping
description: Concat, Merge/Join, Stack/Unstack, Explode
name: Dtype Conversions
description: Unexpected or buggy dtype conversions

Comments:
looks like this is a more limited form of #44940 cc @jbrockmendel 
> looks like this is a more limited form of #44940 cc @jbrockmendel

Related, but that focuses on the non-regex paths whereas this is only-regex paths.
I have made a new commit that solves the dtype issue, request you to check it @jbrockmendel 
Looks good.  Could use a whatsnew note for the bugfix.
Whatsnew note is added @jbrockmendel 
@shubham11941140 can you merge master (conflicts in the tests) and ping on green
Merged master @jreback 
I am getting very weird errors which are not related to the big fix, request you to merge so I can move ahead with the next bug fix.
@jbrockmendel @jbrockmendel  any update?
@jreback , any update?

@jreback  is is green, request you to merge.
thanks @shubham11941140
Remove numpy compat functions
State: closed

- [x] closes #39283
- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit) for how to run them


cc @jbrockmendel 


Labels:
name: Compat
description: pandas objects compatability with Numpy or Python functions

Comments:
very nice @phofl glad to kill these
DOC: `MultiIndex.get_level_values` mentions implicit type casting if level contains null.
State: closed

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

Labels:
name: Docs
name: MultiIndex

Comments:
I was hesitant to write "internally MultiIndex is implemented by codes but regular index doesn't", concerning that reveals too much implementation details in the docstring. Let me know if it fits in.
can you add an example which illustrates this as well.
Example added. @jreback 
thanks @isVoid 
@meeseeksdev backport 1.4.x
Something went wrong ... Please have a look at my logs.
BUG: __from_arrow__ inconsistent strictness
State: closed

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


Labels:
name: Bug
name: Dtype Conversions
description: Unexpected or buggy dtype conversions

Comments:
looks fine to me, but this *can* be user facing right? if so pls add a note

cc @jorisvandenbossche 
whatsnew added + greenish
BUG: ArrayManager not respecting copy keyword
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_codebase.html#pre-commit) for how to run them
- [ ] whatsnew entry


Labels:

Comments:
@jbrockmendel ok here?
i still need to respond to joris's comments
looks reasonable, cc @jorisvandenbossche 
@jorisvandenbossche if any comments
CI: Fix PyPy CI
State: closed

- [ ] closes #xxxx
- [ ] tests added / passed
- [ ] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit) for how to run them
- [ ] whatsnew entry

PyPy was not being pulled correctly. Its fixed now and have confirmed.


Labels:
name: CI
description: Continuous Integration
name: PyPy

Comments:
@github-actions pre-commit.
@lithomas1 can you merge master one more time (as i merged the pypy3 affecting PR :-<>)
@jreback. This is ready now.
There are a couple gotchas, though:
- Cython 0.29.26 doesn't compile correctly for PyPy.
- Coverage is disabled because it slows down everything a lot.
- The CSV reader crashes are gone, but we're crashing a lot elsewhere, and that slows everything down when the crashed workers need to be restarted. So, I set the CI to not restart workers. Some tests may be missed, but otherwise we can't get through the test suite.

I'll open an issue as a follow up.
> https://github.com/pandas-dev/pandas/runs/4562612265?check_suite_focus=true

i think this is actually failing (but the check is not)
> @jreback. This is ready now. There are a couple gotchas, though:
> 
> * Cython 0.29.26 doesn't compile correctly for PyPy.
> * Coverage is disabled because it slows down everything a lot.
> * The CSV reader crashes are gone, but we're crashing a lot elsewhere, and that slows everything down when the crashed workers need to be restarted. So, I set the CI to not restart workers. Some tests may be missed, but otherwise we can't get through the test suite.
> 
> I'll open an issue as a follow up.

totally cool to disable things, basics are all that is needed here
Yeah, I set it to always succeed in the testing phase since a lot of tests fail.
great as a follow up we should skip / xfail o ln pypy3 
@lithomas1 hey if you can shoot me an email 'jeffreback@gmail.com' have some info for you
Added example for num and bool to pandas.Series.str.strip
State: closed

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


Labels:
name: Docs

Comments:
Sure I'll have a look
Hello I am first time contributor. Is this issue still open can I work on it?
@R3dIO  are you interested in continuing?
Sure, let me know how can I help?
I'll review my PR and fix the changed soon
Can I also try too?
Please search for another issue labeled as good first issue. We try to keep ownership, so please don’t Open another pr if someone has already started working on it 
OK. Thank you.
Thanks for the pull request, but it appears to have gone stale. Please merge in main and address the above comments and we can reopen this PR. Closing.
TST: fix tm.to_array nullable handling
State: closed

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


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

Comments:
nice!
BUG: doing a class method lookup in __dealloc__ is dangerous
State: closed

- [x] closes #44253
- [ ] tests added / passed
- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit) for how to run them
- [ ] whatsnew entry

PR #39777 refactored duplicated code, but caused PyPy to fail. This is because `__dealloc__` called `self.close()` which strictly speaking is an attribute lookup, and could fail if the object is partially destroyed, as described in the [documentation for `__dealloc__`](https://cython.readthedocs.io/en/latest/src/userguide/special_methods.html#finalization-method-dealloc). 

Does this need a whatsnew entry?

Labels:
name: IO CSV
description: read_csv, to_csv

Comments:
seems reasonable. if you can rebase as just merged pypy3 in our CI :-> (note we only are supporting >= 3.8) in this release
> just merged pypy3 in our CI

Cool!

>rebase on master

Done


CI is passing
thanks @mattip
BUG: Inconsistent conversion of missing column names
State: closed

- [x] closes #44818
- [x] tests changed / passed
- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit) for how to run them
- [x] whatsnew entry

Factored out multiple occurances of missing name logic into common method.
DataFrame.to_records() changed to use common method rather than missing value count when filling missing names.
Index.to_frame() left alone for the time being.
```
import pandas as pd
f = pd.DataFrame([1], index=pd.MultiIndex.from_arrays([[2],[3],[4]], names=[None, "a", None]))
```
Old behavior: 
```
>>> pd.DataFrame(f.to_records())
   level_0  a  level_1  0
0        2  3        4  1
```
New  behavior:
```
>>> pd.DataFrame(f.to_records())
   level_0  a  level_2  0
0        2  3        4  1
```

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

Comments:
test location makes sense to me
Hello @johnzangwill! 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-12-16 13:28:03 UTC
> not 100% sold on the location (maybe @jbrockmendel can think of a better one)

I suspect that @jreback was referring to the fact that I factored the logic into core/common.py.
It seemed a good place to me. My method is ref'ed in:
- core/frame.py
- core/indexes/multi.py
- io/pytables.py
- io/sql.py
- io/json/_table_schema.py

and core/common is already imported as `com` into every one.
But if you have a better suggestion...
thanks @johnzangwill very nice!
WIP: Debug ResourceWarnings BufferedRandom
State: closed

xref #44844


Labels:

Comments:
might be good to have a test whether `lsof` finds ResourceWarnings (the psutil doesn't seem to find them/some of them).

```py
with pytest.raises(...):
    with check_bufferedrandom_resourcewarning():
        foo = open("foo")
foo.close()
```

Specifically enabling ResourceWarnings (usually disabled by default) seemed to work well for me in #39047: adding `always::ResourceWarning` to `filterwarnings` in setup.cfg.
> might be good to have a test whether `lsof` finds ResourceWarnings (the psutil doesn't seem to find them/some of them).
> 
> ```python
> with pytest.raises(...):
>     with check_bufferedrandom_resourcewarning():
>         foo = open("foo")
> foo.close()
> ```
> 
> Specifically enabling ResourceWarnings (usually disabled by default) seemed to work well for me in #39047: adding `always::ResourceWarning` to `filterwarnings` in setup.cfg.

Yeah might do this in a follow up. Ideally just checking which tests open up new OS-level file handles. Apparently the `BufferedResourceWarning` opens it up at n=10
Closing in favor of https://github.com/pandas-dev/pandas/pull/45073
BUG: ArrowStringArray.copy
State: closed

- [ ] closes #xxxx
- [ ] tests added / passed
- [ ] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit) for how to run them
- [ ] whatsnew entry

Several tests currently fail bc 1) the motivating ArrowStringArray behavior is not working and 2) need a mechanism to let EAs tell tm.shares_memory what to do (maybe make it a classmethod like we do for assert_foo_equal?)

@jorisvandenbossche could use some input on how to actually get a copy here

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

Comments:
> I don't think this change is needed (in any case not by using a slow take). A shallow copy should be sufficient (you can't mutate the arrow array).

Makes sense, thanks.  I'll revert that change and flesh out the docstring to explain this to Future Me.

> (in any case not by using a slow take)

Out of curiosity, what would a better implementation use?

> Also for a normal StringArray, we essentially make a shallow copy (we don't copy the actual string objects).

We do make a copy of the array holding the strings though right?  So `arr.copy()[0] = "foobar"` doesn't change `arr[0]` im pretty sure.  May need a "degrees of shallowness" lexicon if this comes up frequently.
> Out of curiosity, what would a better implementation use?

Pyarrow doesn't provide any functionality to do this at the moment (you also don't generally need this, there is a related issue about this at https://issues.apache.org/jira/browse/ARROW-14982)

> We do make a copy of the array holding the strings though right?

Yes, I mentioned above: One thing we could do is also make a shallow copy of the underlying array itself (eg by taking a slice from start to end). 
(but note that this still is not a "copy" in the pandas sense, it will still point to the same buffers, so the `shares_memory` will still indicate it didn't actually copy anything)
BUG: Index.fillna silently ignoring 'downcast' kwarg
State: closed

- [x] closes #44048
- [x] tests added / passed
- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit) for how to run them
- [ ] whatsnew entry

Decided to raise rather than silently give incorrect result.  Haven't decided about deprecation, since there's an argument to be made for trying to make the downcast kwarg/behavior match Series.fillna (which is itself a can of worms).

Found along the way that CategoricalIndex.fillna can be removed; can make this a separate PR upon request.

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

Comments:
can you add a whatsnew note. also were some examples in the OP which maybe worth adding as tests
BUG: inconsistency in dtype of replace() #44864
State: closed

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


Labels:

Comments:
you already have https://github.com/pandas-dev/pandas/pull/44869 pls don't open multiple PRs for the same issue. you can push to the original.
BUG: fixed fillna('') on a Int64 column causes TypeError: <U3 cannot b…
State: closed

…e converted to an IntegerDtype(#44289)

- [x] closes #44289
- [x] tests added / passed
- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit) for how to run them
- [ ] whatsnew entry

this contribution is for a class project and need not be accepted but feedback is always appreciated

Labels:
name: Missing-data
description: np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate
name: Dtype Conversions
description: Unexpected or buggy dtype conversions
name: Stale

Comments:
@aditzkabitz  can you merge master and address comments
This pull request is stale because it has been open for thirty days with no activity. Please [update](https://pandas.pydata.org/pandas-docs/stable/development/contributing.html#updating-your-pull-request) and respond to this comment if you're still interested in working on this.
Thanks for the pull request, but it appears to have gone stale. If interested in continuing, please merge in main, address the comments and we can reopen.
BUG: inconsistency in dtype of replace() #44864
State: closed

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


Labels:
name: Reshaping
description: Concat, Merge/Join, Stack/Unstack, Explode
name: Dtype Conversions
description: Unexpected or buggy dtype conversions
name: Stale

Comments:
can you write a test for this
Hello @jreback and @jbrockmendel, 
0cdfa4d1c1dfda5257e3838d06a145de9403a278 - has the same changes as in this last commit.
But 0cdfa4d1c1dfda5257e3838d06a145de9403a278  completed all tests succsesfull. 
Looks like that here is some problem with 
Database / Linux_py38_IO (ci/deps/actions-38-db-min.yaml) (pull_request)  https://codecov.io, not in my code.

Could you please help me? 

@vsydoriak99 this PR needs a test
@vsydoriak99 don't worry about the codecov issue, that usually resolves itself if we wait a while.

What this PR needs is a test for the fixed behavior.  In either tests.frame.methods.test_replace or tests.series.methods.test_replace
Hello @vsydoriak99! 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-12-16 16:33:29 UTC
@vsydoriak99 if you'd merge master and address 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.
@vsydoriak99 can you rebase and address comments
Thanks for the PR, but it appears to have gone stale. If interested in continuing, please address the merge conflict and comments and we can reopen.
CI/TST: Run http server in process instead of thread for test_user_agent.py
State: closed

- [x] tests added / passed
- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit) for how to run them

Part 3 in trying to avoid timeouts in this test


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

Comments:
ok let's open/close this a few times to see if CI still ok
thanks @mroeschke
CLN: Split/parameterize test_to_datetime
State: closed

- [x] tests added / passed
- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit) for how to run them

* Split long tests
* Parameterize tests where available


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

Comments:
thanks @mroeschke 

OT: what's up with the codecov?
> thanks @mroeschke
> 
> OT: what's up with the codecov?

Might have been related to https://status.codecov.com/incidents/vw0dlln5qc35?u=qz2dsxbwb12g?
PERF: any/all with axis=1
State: closed

```
from asv_bench.benchmarks.frame_methods import *
self = Dropna()
self.setup("any", 0)

%timeit self.time_dropna_axis_mixed_dtypes("any", 0)
23.6 ms ± 524 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)  # <- master
10.3 ms ± 190 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)  # <- PR
```

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

Comments:
updated+greenish (CI failure is codecov)
Add 'color' and 'size' to arguments
State: closed

This changes use more intuitive names for 'color' and 'size' and use the same notation like in '_bar_or_line_doc'.

- [ ] closes #44670

Labels:
name: Visualization
description: plotting
name: API - Consistency
description: Internal Consistency of API/Behavior
name: Stale

Comments:
@mosc9575 if you'd merge master and addrress comments
Hello @mosc9575! 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 2022-04-06 15:00:47 UTC
Thanks a lot to all of you for your help and your suggestions. I am learning a lot.
I have a question: `bar` and  `line` have the same docstring. Now I only changed `bar` and `hbar`, which now accept `c` as a parameter for `color`. This is not implemented for `line` yet. Therefore I didn't change the docstring. Now this looks odd to me. Should I also implement this changes to `line` or should I revert the changes for `bar` and `hbar`? In my opinion only accepting `color` is much more intuative and this issue is solved if `scatter` also accepts `color`.
> only accepting color is much more intuative

Is it worth breaking backwards compatibility for this?

I'd suggest either:
- implement this for `line` as well, OR
- de-couple the shared docstring between `bar` and `line` 
If I don't touch `bar` and `hbar` and only add `color` and `size` as keyword arguments  to `scatter` I don't break anything. I am not sure if `bar` and `hbar` really need to accept `c` because this is not used in matplotlib and now it works well with `color`. In this case I don't have to make any changes to the docstring except in the `scatter` function.



> I am not sure if `bar` and `hbar` really need to accept `c` because this is not used in matplotlib and now it works well with `color`. In this case I don't have to make any changes to the docstring except in the `scatter` function.

Ah I see - yeah sounds good to me
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.
should we deprecate passing c/s ? (or are these *also* accepted by mpl)?
> are these _also_ accepted by mpl?

looks like they're inconsistent, `scatter` takes `c`, `bar` takes `color` 

https://matplotlib.org/3.5.0/api/_as_gen/matplotlib.pyplot.scatter.html
https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.bar.html
> > are these _also_ accepted by mpl?
> 
> looks like they're inconsistent, `scatter` takes `c`, `bar` takes `color`
> 
> https://matplotlib.org/3.5.0/api/_as_gen/matplotlib.pyplot.scatter.html https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.bar.html

ok over time prob a good idea to use color/size (even if mpl accepts more). 
thanks @mosc9575 
You are welcome. I appreciated your cooperation and help.
TYP: stricter type for compression
State: closed


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

Comments:
Hello @twoertwein! 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-12-11 22:19:47 UTC
thanks @twoertwein