BrandonFors/pandas-github-issues huggingface dataset:
BUG: transpose casts mixed dtypes to object
State: closed

- [x] closes #43337
- [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: Dtype Conversions
description: Unexpected or buggy dtype conversions
name: Stale

Comments:
All the failures are from the below two, not sure why .These are passing in some cases (also in my local). 
Would be really helpful if someone can point me to the correct direction.
```
FAILED pandas/tests/frame/methods/test_transpose.py::TestTranspose::test_transpose_tzaware_2col_mixed_tz
FAILED pandas/tests/frame/methods/test_transpose.py::TestTranspose::test_transpose_object_to_tzaware_mixed_tz
> All the failures are from the below two, not sure why .These are passing in some cases (also in my local).
> Would be really helpful if someone can point me to the correct direction.
> 
> ```
> FAILED pandas/tests/frame/methods/test_transpose.py::TestTranspose::test_transpose_tzaware_2col_mixed_tz
> FAILED pandas/tests/frame/methods/test_transpose.py::TestTranspose::test_transpose_object_to_tzaware_mixed_tz
> ```

Based on a quick look, initial guess might be different `numpy` versions. Maybe try using the same `numpy` version as one of the failing builds (or just see if you can reproduce with an matching requirements file, which you can find at `pandas/ci/deps`)
> test_transpose_tzaware_2col_mixed_tz

Best guess is something weird is going on with find_common_type between dt64tz[US/Eastern] and dt64tz[US/Pacific].  I think find_common_type should return object, but in some places we pretend that the common type is dt64tz[UTC]
ok if you can merge master will look again
this very likley changes a number of tests you will have to edit those
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.
status of this?
sorry, was not able to give time into this.. 
will take a look again, sorry for the delay
Thanks @debnathshoham but appears this PR has gone stale. When you have the time feel free to merge master and we can reopen. Closing for now.
PERF: merge
State: closed

```
from asv_bench.benchmarks.join_merge import *
self6 = Merge()
self6.setup(False)

%timeit self6.time_merge_dataframes_cross(False)
535 ms ± 4.25 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)  # <- master
242 ms ± 5.98 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)  # <- PR


self6.setup(True)
%timeit self6.time_merge_dataframes_cross(True)
540 ms ± 9.13 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)  # <- master
243 ms ± 4.57 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)  # <- PR
```

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

Comments:
wow
CLN: remove typing ignores
State: closed

mypy now passes without ignorance


Labels:
name: Clean
name: Typing
description: type annotations, mypy/pyright type checking
name: Styler
description: conditional formatting using DataFrame.style

Comments:
Actually this is green on my local `mypy`, which is upto date with pandas requirements file, but the CI here seems to require the type ignore comments.
@MarcoGorelli can you give me a hint?
> Actually this is green on my local `mypy`, which is upto date with pandas requirements file, but the CI here seems to require the type ignore comments.
> @MarcoGorelli can you give me a hint?

:thinking: are the rest of your dependencies up to date? Perhaps do another `conda env update -f environment.yml` then `conda activate pandas-dev`?
Another suggestion I've seen here is to run `mypy pandas --no-incremental`
> 
> 🤔 are the rest of your dependencies up to date? Perhaps do another `conda env update -f environment.yml` then `conda activate pandas-dev`?
> Another suggestion I've seen here is to run `mypy pandas --no-incremental`

I reinstalled a py3.9 environment and installed dependencies with pip. Still get the stange mypy behaviour here, even with the --no-incremental flag.

will close this, seems to be my local error
BUG: DataFrame.explode is failing on scalar int value.
State: closed

closes #43314 

The **int** datatype of the column was raising this issue.

- [x] 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: Bug
name: Reshaping
description: Concat, Merge/Join, Stack/Unstack, Explode
name: Regression
description: Functionality that used to work in a prior pandas version

Comments:
@shubh242 can you aslo add a whatsnew note in 1.3.3, put in the bug fix reshaping section is ok
> put in the bug fix reshaping section is ok

@shubh242  in the 1.3.x release notes we don't have the subsections. so just add to the regressions section.
@shubh242 are you interested in continuing?
> @shubh242 are you interested in continuing?

Yes i would like to give it another try. Can you be specific about what is failing by doing the change.
Please adress the review comments above 
@shubh242 this PR is not yet ready (needs release note and tests) and planning a release tomorrow, moving to 1.3.4 milestone.
@shubh242 if you can update to comments and merge master
superseded by https://github.com/pandas-dev/pandas/pull/43802
Update test_sorting.py
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:

Comments:
Please don't do this
@jreback, can @DeepakPareta be blocked from pandas please? It's the third time in 24h that they submit this https://github.com/pandas-dev/pandas/pulls?q=is%3Apr+author%3ADeepakPareta+is%3Aclosed
@MarcoGorelli done
Datetime series slicing - error without loc()
State: closed

Problem:
Date time series on slicing might produce errors for different reasons(change in data format for each, unsorted DateTime inputs etc.)  which can be avoided with "loc() on the DateTime".
The error was like *** Slicing with this method is *always* positional.***

After correcting the Issue : (Screenshots)
https://docs.google.com/document/d/1L5Ei0q5BfHCTnfzG43exvTug_N1OE7UEmxbgB0KjIh4/edit?usp=sharing

Issue: 43223

Code testing :
    
    import pandas as pd
    import numpy as np
    df = pd.DataFrame(
        {'ind': [i for i in range(5)]}, 
        index=pd.DatetimeIndex(["11.01.2011 22:00", "11.01.2011 23:00", "12.01.2011 00:00", "2011-01-13 00:00","2011-01-14 00:00"]))
    
    df.loc["2011-01-01": "2011-11-01"].plot()

Test Dataset:

                     ind
        2011-11-01 22:00:00    0
        2011-11-01 23:00:00    1
        2011-12-01 00:00:00    2
        2011-01-13 00:00:00    3
        2011-01-14 00:00:00    4

The above code works perfectly with loc() added and is one of the test case examples.

- [ ] 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:

Comments:
Agreed and this is known with the `:okwarning:` in the iPython block.

Thanks for the contribution but closing.
REF: `Styler.export`
State: closed

- [x] closes #40675
- [x] tests added / passed
- [x] whatsnew entry

Finishes a series of PRs for the tracker


Labels:
name: Styler
description: conditional formatting using DataFrame.style

Comments:
are these in the reference docs?
> are these in the reference docs?

I added one and it is included in the user guide.
BENCH: tighter targeting on ChainedIndexing benchmark
State: closed

ATM almost half of the benchmark runtime is in the DataFrame constructor.

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

Comments:
Test failures look unrelated - restarting CI.


```
  File "pandas\_libs\tslibs\tzconversion.pyx", line 383, in pandas._libs.tslibs.tzconversion.tz_convert_utc_to_tzlocal
.    return _tz_convert_tzlocal_utc(utc_val, tz, to_utc=False, fold=fold)
  File "pandas\_libs\tslibs\tzconversion.pyx", line 594, in pandas._libs.tslibs.tzconversion._tz_convert_tzlocal_utc
    delta = _tzlocal_get_offset_components(val, tz, to_utc, fold)
  File "pandas\_libs\tslibs\tzconversion.pyx", line 554, in pandas._libs.tslibs.tzconversion._tzlocal_get_offset_components
    dt = dt.astimezone(tz)
  File "C:\Miniconda\envs\pandas-dev\lib\site-packages\dateutil\tz\_common.py", line 144, in fromutc
    return f(self, dt)
  File "C:\Miniconda\envs\pandas-dev\lib\site-packages\dateutil\tz\_common.py", line 261, in fromutc
    _fold = self._fold_status(dt, dt_wall)
  File "C:\Miniconda\envs\pandas-dev\lib\site-packages\dateutil\tz\_common.py", line 196, in _fold_status
    if self.is_ambiguous(dt_wall):
  File "C:\Miniconda\envs\pandas-dev\lib\site-packages\dateutil\tz\tz.py", line 254, in is_ambiguous
    naive_dst = self._naive_is_dst(dt)
  File "C:\Miniconda\envs\pandas-dev\lib\site-packages\dateutil\tz\tz.py", line 260, in _naive_is_dst
    return time.localtime(timestamp + time.timezone).tm_isdst
OSError: [Errno 22] Invalid argument
..............................x.....
```
/azp run
<samp>
Azure Pipelines successfully started running 1 pipeline(s).<br>

</samp>
lgtm. @alimcmaster1 merge on green.
/azp run
<samp>
Azure Pipelines successfully started running 1 pipeline(s).<br>

</samp>
PERF: DataFrame[object].fillna
State: closed

```
from asv_bench.benchmarks.frame_methods import *

self5 = Fillna()
self5.setup(False, 'pad', 'object')

%timeit self5.time_frame_fillna(False, 'pad', 'object')
191 ms ± 5.41 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)  # <- master
127 ms ± 5.03 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)  # <- PR
```

Labels:
name: Missing-data
description: np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate
name: Performance
description: Memory or execution speed performance

Comments:
can you rebase just to be sure
rebased + green
BUG: Fix `pd.to_numeric` to have consistent behavior for date-like arguments
State: closed

- [ ] closes #43280
- [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

`pd.to_numeric` was having an inconsistent behavior when using in datelike objects and was returning wrong result when using with `pd.NaT`


**In master:**
```python
>>> import pandas as pd
>>> from datetime import datetime
>>> from functools import partial
>>> pd.to_numeric(datetime(2021, 8, 22), errors="coerce")
nan
>>> pd.to_numeric(pd.Series(datetime(2021, 8, 22)), errors="coerce")
0    1629590400000000000
dtype: int64
>>> pd.Series([datetime(2021, 8, 22)]).apply(partial(pd.to_numeric), errors="coerce")
0   NaN
dtype: float64
>>>
>>> pd.to_numeric(pd.NaT, errors="coerce")
nan
>>> pd.to_numeric(pd.Series(pd.NaT), errors="coerce")
0   -9223372036854775808
dtype: int64
>>> pd.Series(pd.NaT).apply(partial(pd.to_numeric), errors="coerce")
0   NaN
dtype: float64

```

**In this PR:**
```python
>>> import pandas as pd
>>> from datetime import datetime
>>> from functools import partial
>>> pd.to_numeric(datetime(2021, 8, 22), errors="coerce")
nan
>>> pd.to_numeric(pd.Series(datetime(2021, 8, 22)), errors="coerce")
0   NaN
dtype: float64
>>> pd.Series([datetime(2021, 8, 22)]).apply(partial(pd.to_numeric), errors="coerce")
0   NaN
dtype: float64
>>>
>>> pd.to_numeric(pd.NaT, errors="coerce")
nan
>>> pd.to_numeric(pd.Series(pd.NaT), errors="coerce")
0   NaN
dtype: float64
>>> pd.Series(pd.NaT).apply(partial(pd.to_numeric), errors="coerce")
0   NaN
dtype: float64
```

Please let me know if this approach makes sense so I can add the tests.

Labels:
name: Stale

Comments:
Hello @hec10r! 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-08-31 14:35:27 UTC
i thing already data is consider as object , then why you again defining as a object
@jreback Thanks for your review.

This PR will likely be close and I will open a new one based on the discussion that we had in https://github.com/pandas-dev/pandas/issues/43280. It would be great to have your input there as well.
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.
Thanks for the PR but as mentioned in https://github.com/pandas-dev/pandas/issues/43280#issuecomment-910349096, this will probably need a different approach. Closing due to being stale
BUG: Fix some parse dates tests for the Arrow CSV reader
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

Fixes around 21 tests. This fix was left out of the original PR in the interest of keeping that one small.


Labels:
name: IO CSV
description: read_csv, to_csv
name: Arrow
description: pyarrow functionality

Comments:
thanks @lithomas1
PERF: use _get_axis_number instead of if axis in [...]
State: closed

Added _get_axis_number in style.py as per the standards 


Labels:

Comments:
Hello @KiranHipparagi! 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-08-30 18:44:10 UTC
A pr for this was already merged 
@phofl yes i know but there is one more change we need look at..
```
axis = self.data._get_axis_number(axis)            <-- PR
result = data.apply(func, axis=0, **kwargs) if axis == 0 
    else (data.T.apply(func, axis=0, **kwargs).T if axis == 1 
    else func(data, **kwargs))
       
 if axis in [0, "index"]:                           <--master
         result = data.apply(func, axis=0, **kwargs)
 elif axis in [1, "columns"]:
         result = data.T.apply(func, axis=0, **kwargs).T  # see GH 42005
 else:
     result = func(data, **kwargs)
```
Please resolve conflicts first 
@phofl thanks for the clarification.please review i have resolved conflicts.
-1. I like it the way it is. As @phofl states this has already had a recent PR fix.
@attack68 @phofl Thanks for the clarification.I'm new to open source project.Is there any file left for modification apart from style.py?
@KiranHipparagi did a quick search, it seems outside of tests, this is pretty clean actually. Do find another issue marked "good first issue".
Update conftest.py
State: closed

- [x] 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


Labels:

Comments:
Hello @DeepakPareta! 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/conftest.py`](https://github.com/pandas-dev/pandas/blob/c6e3c0d6a58d65a9d69f6843afbf9710b2352471/pandas/conftest.py):

> [Line 34:1](https://github.com/pandas-dev/pandas/blob/c6e3c0d6a58d65a9d69f6843afbf9710b2352471/pandas/conftest.py#L34): [W293](https://duckduckgo.com/?q=pep8%20W293) blank line contains whitespace


Please send pull request
please do these experiments on your own repo
BUG: Solves errors when calling series methods in DataFrame.query with numexpr
State: closed

- [x] closes #22435
- [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

The initial issue #22435 (check that there is no conflicting names failing) was actually hiding a deeper one leading to a failure when calling `numexpr.evaluate()`.

The commit proposed here solves both issues by adding a temporary variable to the scope for the results of function / method calls when using numexpr engine.

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

Comments:
The condition on numexpr is may be too strong, may be we should do the trick only for unhashable results and when using numexpr ?
Hello @AlexisMignon! 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-09-24 08:09:00 UTC
very nice @AlexisMignon thanks!
TST: added test for to_string when max_rows is zero (GH35394)
State: closed

- [x] closes #35394
- [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

Provided tests for `to_string` when `max_rows=0`.

Tests and linter pass locally.

Labels:
name: Testing
description: pandas testing functions or related to the test suite
name: Output-Formatting
description: __repr__ of pandas objects, to_string

Comments:
Thanks for the review @alimcmaster1
/azp run
<samp>
Azure Pipelines successfully started running 1 pipeline(s).<br>

</samp>
thanks @lorenzophys
ENH: Added multi index functionality (new level kwarg) to Dataframe.filter
State: closed

- [x] closes #42970
- [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: Bug
name: Enhancement
name: Indexing
description: Related to indexing on series/frames, not to indexes themselves
name: API Design
name: MultiIndex
name: Stale

Comments:
Hello @ShreyasPatel031! 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-08-30 14:31:03 UTC
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.
@ShreyasPatel031 can you fix ci fails and resolve merge conflicts.
@ShreyasPatel031 there's a xlsx binary shown in the diff. this is not part of this PR?
Appears this PR has gone stale, so closing. If interested in continuing, please merge master, address the review and failing tests and we can reopen.
PERF: use _get_axis_number instead of if axis in [...]: #43048
State: closed

 Added _get_axis_number in test_at_time.py as per the standards

``` 
 if axis in ["index", 0]:              #<- master
      expected = ts.loc[indices, :]
 elif axis in ["columns", 1]:
      expected = ts.loc[:, indices]

 axis = self.data._get_axis_number(axis)   #<- PR
 expected = ts.loc[indices, :] if axis == 0 else ts.loc[:, indices]
```

Labels:

Comments:
Thanks @KiranHipparagi for the PR. from #43048

> ...non-test codebase (i.e. don't find code examples in pandas/tests)

so closing this one.
@simonjayhawkins can you please tell me why this PR closed. i'm new to open source contribution.This is my first PR on git.
see https://github.com/pandas-dev/pandas/issues/43048#issuecomment-907582458

> Don't try and fix test files in pandas/tests.
@simonjayhawkins Thank you for the clarification.
1.1.x
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
found a small typo in the README

Labels:

Comments:
I assume that a wrong button was pressed?
Update range.py
State: closed

Now it will work

- [ ] 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:

Comments:
Hello @augas2k1! 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/indexes/range.py`](https://github.com/pandas-dev/pandas/blob/2a9f5d6af52bc309d6dd83c31ffee3a9a173f0e4/pandas/core/indexes/range.py):

> [Line 19:1](https://github.com/pandas-dev/pandas/blob/2a9f5d6af52bc309d6dd83c31ffee3a9a173f0e4/pandas/core/indexes/range.py#L19): [W293](https://duckduckgo.com/?q=pep8%20W293) blank line contains whitespace
> [Line 444:89](https://github.com/pandas-dev/pandas/blob/2a9f5d6af52bc309d6dd83c31ffee3a9a173f0e4/pandas/core/indexes/range.py#L444): [E501](https://duckduckgo.com/?q=pep8%20E501) line too long (89 > 88 characters)
updated yaml anchors in additional dependencies
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:

Comments:
Sir , i am not able to understand what i have to change . The anchor is applied in both the hooks and and code has passed all 5 checks successfully.
Please guide me i am new here
Try running
```
pre-commit run flake8 --all-files
```
If that doesn't pass, then neither will the remaining checks. The checks which have run so far are the ones which don't require approval and don't include the pre-commit checks
pre-commit is not working in my system is there any other way to test these files
> pre-commit is not working in my system 

what do you mean? can you show some output?
![image](https://user-images.githubusercontent.com/66488262/131364374-014b3fab-fd02-4855-84e6-94f0c73a6244.png)
pre-commit is installed but it is still showing this error:

'pre-commit' is not recognized as an internal or external command,
operable program or batch file.

please see [here](https://pandas.pydata.org/pandas-docs/stable/development/contributing_environment.html) for how to set up a development environment - once you have it set up and have pre-commit working, you can try this again

> pre-commit is not working in my system is there any other way to test these files
Just added asterisk
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:

Comments:
Thanks for the pull request, but this change is not significant enough to merge. If you would like to contribute, we recommend addressing issues with the `good first issue` label. Closing.
PERF: Styler 2
State: closed

extends the idea pushed by @jbrockmendel in #43285 

```python
>>> df = pd.DataFrame(np.random.randn(10000, 1))
>>> % timeit df.style.applymap_index(lambda v: "color: blue;")._compute()
29.7 ms ± 396 µs per loop (mean ± std. dev. of 7 runs, 10 loops each) # Master
24.4 ms ± 347 µs per loop (mean ± std. dev. of 7 runs, 10 loops each) # PR
```

Labels:
name: Performance
description: Memory or execution speed performance
name: Styler
description: conditional formatting using DataFrame.style

Comments:
thanks @attack68