BrandonFors/pandas-github-issues huggingface dataset:
Cleanup in hist.py
State: closed

Found a small typo in hist.py


Labels:

Comments:
Hello @Gowthami-R! 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/plotting/_matplotlib/hist.py`](https://github.com/pandas-dev/pandas/blob/324239c8a7f00dba1af1febe794e43e32f8f02ce/pandas/plotting/_matplotlib/hist.py):

> [Line 249:89](https://github.com/pandas-dev/pandas/blob/324239c8a7f00dba1af1febe794e43e32f8f02ce/pandas/plotting/_matplotlib/hist.py#L249): [E501](https://duckduckgo.com/?q=pep8%20E501) line too long (91 > 88 characters)
> [Line 403:53](https://github.com/pandas-dev/pandas/blob/324239c8a7f00dba1af1febe794e43e32f8f02ce/pandas/plotting/_matplotlib/hist.py#L403): [W291](https://duckduckgo.com/?q=pep8%20W291) trailing whitespace
> [Line 512:1](https://github.com/pandas-dev/pandas/blob/324239c8a7f00dba1af1febe794e43e32f8f02ce/pandas/plotting/_matplotlib/hist.py#L512): [W391](https://duckduckgo.com/?q=pep8%20W391) blank line at end of file
PERF: Styler
State: closed

```
from asv_bench.benchmarks.io.style import *
self = Render()
self.setup(36, 12)

%timeit self.setup(36, 12); self.time_apply_render(36, 12)
29.2 ms ± 1.2 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)  # <- master
9.98 ms ± 706 µs per loop (mean ± std. dev. of 7 runs, 1 loop each)  # <- PR
```

cc @attack68 

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

Comments:
nice. good spot. lgtm. tests seem unrelated. there might be one or two other places this pattern might be better too.
thanks @jbrockmendel
ENH: `styler.latex` options
State: closed

adds item to #41395 

- [x] added to config
- [x] method and docstrings added
- [x] options.rst docs
- [x] adds tests
- [x] whatsnew entry

will update user guide as a follow on after all options added.


Labels:
name: Enhancement
name: IO LaTeX
description: to_latex
name: Styler
description: conditional formatting using DataFrame.style

Comments:
looks fine, can you rebase to make sure failures unrelated.
rebase :->
ENH: `styler.html.mathjax` option
State: closed

This pandas option is added to allow the `Styler` options to be independent from the others. See #41395

 - [x] add option in config
 - [x] add tests
 - [x] whats new
 - [x] `options.rst`

will update styler user guide as a follow on when all options PRs merged.

![Screen Shot 2021-08-29 at 10 01 55](https://user-images.githubusercontent.com/24256554/131243266-a35e12be-43fa-4be8-8350-c538e32abd80.png)


Labels:
name: Enhancement
name: IO HTML
description: read_html, to_html, Styler.apply, Styler.applymap
name: Styler
description: conditional formatting using DataFrame.style

Comments:
can you rebase
PERF: column_arrays
State: closed

Shaves a couple percent off of time_to_json_wide asv

Reprises #42824.

Labels:
name: Performance
description: Memory or execution speed performance
name: IO JSON
description: read_json, to_json, json_normalize

Comments:
hmm just a couple of percent?
> hmm just a couple of percent?

I'm seeing 13.5% locally

```
from asv_bench.benchmarks.io.json import *

self = ToJSONWide()
self.setup("columns", "df_td_int_ts")

%timeit self.time_to_json_wide("columns", "df_td_int_ts")
82.4 ms ± 1.71 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)  # <- master
71.3 ms ± 1.68 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)  # <- PR
```
just converned this is too specialy casey for json. but not a big deal.
Column_arrays is already only for json

On Tue, Aug 31, 2021 at 4:55 PM Jeff Reback ***@***.***>
wrote:

> just converned this is too specialy casey for json. but not a big deal.
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/pandas-dev/pandas/pull/43278#issuecomment-909739478>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AB5UM6EYTGGBZGGFMTUKAS3T7VTV3ANCNFSM5C7PZTMA>
> .
> Triage notifications on the go with GitHub Mobile for iOS
> <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
> or Android
> <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
>
>

gentle ping; this is the last of the asv-identified perf PRs
PERF: read_stata
State: closed

```
from asv_bench.benchmarks.io.stata import *

self = StataMissing()
self.setup("td")

%timeit self.time_read_stata("td")
113 ms ± 1.44 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)  # <- master
94.4 ms ± 1.72 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)  # <- PR
```

cc @bashtage

Labels:
name: Performance
description: Memory or execution speed performance
name: IO Stata
description: read_stata, to_stata

Comments:
Thanks @jbrockmendel
TST: makeMultiIndex not respecting k parameter
State: closed

- [x] closes #38795
- [x] 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: Testing
description: pandas testing functions or related to the test suite
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-28 18:19:23 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.
Appears this PR has been dormant for a while and needs updates so closing. If interested in continuing, please merge master, address related comments and we can reopen.
DOC: erroneous initialization of a DataFrame with Series objects GH42818
State: closed

- [ ] closes #42818 
- [ ] 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
- [ ] modified `azure-pipelines.yml`


Labels:

Comments:
Why would changing azure pipelines be the solution to this issue?
Closing as there's also already an open pull request resolving this issue (#42818)
TST: added test for ea dtypes conversion to datetimetzdtype (GH37553)
State: closed

- [x] closes #37553
- [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 type cast `ExtensionDtypes` -> `DatetimeTZDtype`.

Tests and linter pass locally.

Labels:
name: Testing
description: pandas testing functions or related to the test suite
name: Dtype Conversions
description: Unexpected or buggy dtype conversions
name: Timezones
description: Timezone data dtype
name: ExtensionArray
description: Extending pandas with custom dtypes or arrays.

Comments:
Thank you for the review @mzeitlin11, the new location makes much more sense.
thanks @lorenzophys
PERF: to_datetime with uint
State: closed

- [x] closes #42606
- [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

```python
#PR
In [3]: %time index = pd.to_datetime(np.arange(1_000_000).astype("uint64"), unit="s", utc=True)
CPU times: user 20.6 ms, sys: 19.9 ms, total: 40.5 ms
Wall time: 39.2 ms

In [4]: %time index = pd.to_datetime(np.arange(1_000_000).astype("uint32"), unit="s", utc=True)
CPU times: user 16.3 ms, sys: 6.58 ms, total: 22.8 ms
Wall time: 21.2 ms

#master
In [3]: %time index = pd.to_datetime(np.arange(1_000_000).astype("uint64"), unit="s", utc=True)
CPU times: user 12.6 s, sys: 44.3 ms, total: 12.7 s
Wall time: 12.7 s

In [4]: %time index = pd.to_datetime(np.arange(1_000_000).astype("uint32"), unit="s", utc=True)
CPU times: user 5.88 s, sys: 21.2 ms, total: 5.9 s
Wall time: 5.92 s
```

Labels:
name: Datetime
description: Datetime data dtype
name: Performance
description: Memory or execution speed performance

Comments:
thanks @debnathshoham very nice
REF: Remove Numba compat pre 0.50.1
State: closed

No longer needed since the bump https://github.com/pandas-dev/pandas/issues/43257#issuecomment-907452377

Labels:
name: numba
description: numba-accelerated operations

Comments:
Thanks @mroeschke There a still min versions set in `pandas/tests/window/conftest.py`. can these be removed too?
Thanks. Yes, just removed those as well.
Thanks @mroeschke
DEPR: Passing in a string column label for DataFrame.ewm(times=...)
State: closed

- [x] xref https://github.com/pandas-dev/pandas/pull/42834#discussion_r680451102
- [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: Deprecate
description: Functionality to remove in pandas
name: Window
description: rolling, ewma, expanding

Comments:
umm we generally accept a column name for other things, why are we deprecating here?
- https://github.com/pandas-dev/pandas/pull/42834 deprecated dropping nuisance column in window ops (raising a `TypeError` in the future)
- A `times` column will always be a nuisance column because windows ops only accept numeric values and `times` will be a `datetime64[ns]`, so this functionality as is will always raise a `TypeError` in the future
thanks @mroeschke
TST: added tests for to_json when called on complex data (GH41174)
State: closed

- [x] closes #41174
- [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_json` when called on complex data on both `Series` and `DataFrame`. Coefficients are both `int` and `float`.

Tests and linter pass locally.


Labels:
name: Testing
description: pandas testing functions or related to the test suite
name: IO JSON
description: read_json, to_json, json_normalize

Comments:
Thanks @lorenzophys
ENH: `styler.format` options
State: closed

- [x] adds to #41395 
- [x] add options
- [x] add tests
- [x] update `Styler.format` docstring
- [x] update `options.rst`
- [x] update `Styler` init docstring
- [x] whatsnew

update user guide **will be a follow-on when all options are merged**

![Screen Shot 2021-08-28 at 13 26 44](https://user-images.githubusercontent.com/24256554/131216430-ef0a76bc-7ae7-4576-aa05-c684b13db67a.png)


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

Comments:
thanks pls check the options on the issue :->
> looks good. technically this could break code if some actually uses `pd.set_option('precision')` for example but that will now raise so prob ok.

the docs do advise against that behaviour for this specific reason, so I think ok.
WEB: Updated list of active maintainers #43254
State: closed

Added *attack68, fangchenli, twoertwein, tswast* to the list of active maintainers.

- [X] closes #43254
- [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


Labels:
name: Web
description: pandas website

Comments:
cc @attack68 @fangchenli @twoertwein in case anyone wants to opt out
BUG: fix is_named_tuple for objects that are not subclass of tuple #40682
State: closed

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


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

Comments:
looks fine. @fangchenli merge when greenish (pls look at the failure, looks not-related)
thanks @fangchenli
TYP: cache_readonly
State: closed

- [x] closes #41588
- [ ] 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

I'm not sure how to test this on the CI - pyright is happy on my machine:
```py
import pandas as pd

index: pd.IntervalIndex = pd.IntervalIndex.from_arrays([1], [2])
reveal_type(index)
reveal_type(index.right)
```
```
info: Type of "index" is "IntervalIndex"
info: Type of "index.right" is "Index"
```

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

Comments:
If the CI failures prove hard to resolve, could we cheat and write in the .pyi something like `class cache_readonly(property): pass`?
> If the CI failures prove hard to resolve, could we cheat and write in the .pyi something like `class cache_readonly(property): pass`?

I must admit, I didn't notice the many mypy failures. I will put the PR into draft mode and locally debug it until I get it working. I will ping you when it is ready :)
> If the CI failures prove hard to resolve, could we cheat and write in the .pyi something like `class cache_readonly(property): pass`?

I mistakenly used `Protocol` instead of `Generic`: roughly half of the errors are gone now. There are still many legitimate errors left.

Some remaining `[arg-type]` errors on unions and `[override]` errors  are probably due to a mypy issue (opened https://github.com/python/mypy/issues/11037).
see https://github.com/pandas-dev/pandas/issues/41588#issuecomment-911661736
Bug in RangeIndex.where raising AssertionError when result is not from RangeIndex
State: closed

- [x] closes #43240
- [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

cc @jbrockmendel 
2 options here:
- calling ``_shallow_copy`` which handles the cast to Int64Index in theses cases
- implementing a similar logic in ``_simple_new`` passing the call through to Int64Index or Float64Index depending on the dtype

But not sure if this would be counterintuitive for ``_simple_new``.

Labels:
name: Regression
description: Functionality that used to work in a prior pandas version
name: Index
description: Related to the Index class or subclasses

Comments:
Thanks @phofl
converted the assert error to TypeError with proper informative message
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:
Hello @harshitsinha6! 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:

* In the file [`pandas/core/indexes/base.py`](https://github.com/pandas-dev/pandas/blob/4b47bbaf069d08bd33ed15e0b1582b0f86399b34/pandas/core/indexes/base.py):

> [Line 637:1](https://github.com/pandas-dev/pandas/blob/4b47bbaf069d08bd33ed15e0b1582b0f86399b34/pandas/core/indexes/base.py#L637): [W293](https://duckduckgo.com/?q=pep8%20W293) blank line contains whitespace



##### Comment last updated at 2021-08-27 14:50:10 UTC
Please add tests if this is somehow visible
> Please add tests if this is somehow visible

I am not able to see/find the test file. If possible can you please share the file path? will look into that.
Please run pre-commit locally before pushing. You have a linting bug.

What are you using to reproduce the error? Test belongs somewhere into the tests/indexes folder
> Please run pre-commit locally before pushing. You have a linting bug.
> 
> What are you using to reproduce the error? Test belongs somewhere into the tests/indexes folder



> Please run pre-commit locally before pushing. You have a linting bug.
> 
> What are you using to reproduce the error? Test belongs somewhere into the tests/indexes folder

@phofl since I am beginner, can you please point out that linting bug because in local it is running properly.
> what are you trying to do?
> this is an internal assertion
> if it's violated then that is a bug
> making a type error is not useful

"BUG: wrong/confusing error message in DataFrame.take with a scalar indexer"
and  "take requires an array-like for the indexer, but when passing a scalar you get a not very useful error message as above. **We should raise a ValueError (or rather TypeError) instead with an informative message."**_

I thought, this was the issue.


sure but this is way too low level
you should validate this in .take itself
> sure but this is way too low level
> you should validate this in .take itself

yes, but the error arises in "assert isinstance(values, np.ndarray), type(values)" and as per the requirement we have to display proper message with proper error.
but in .take it is not raising any error or it showing any relevant message.
@harshitsinha6 looks to already be being fixed in #42886? Also see that pr for what was meant by validating in take, not here
closing as a duplicate of #42886
Warn on du parse
State: closed

- [ ] closes #12585
- [ ] 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: Datetime
description: Datetime data dtype
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, will get back to it when I get a chance
DOC PR09 Add "." on to_hdf format parameter
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

From #28602:
```
pandas.Series.to_hdf: Parameter "format" description should finish with "."
pandas.DataFrame.to_hdf: Parameter "format" description should finish with "."
```

Labels:
name: Docs

Comments:
@MarcoGorelli From what I've seen, these are all done:

```
pandas.read_excel: Parameter "usecols" description should finish with "."
pandas.read_sql: Parameter "con" description should finish with "."
pandas.DataFrame.corr: Parameter "method" description should finish with "."
pandas.Series.to_sql: Parameter "con" description should finish with "."
pandas.DataFrame.to_sql: Parameter "con" description should finish with "."
pandas.io.formats.style.Styler: Parameter "na_rep" description should finish with "."
pandas.io.formats.style.Styler.format: Parameter "formatter" description should finish with "."
pandas.io.formats.style.Styler.format: Parameter "na_rep" description should finish with "."
```

Cannot speak for the rest.

```
pandas.testing.assert_categorical_equal: Parameter "check_dtype" description should finish with "."
pandas.testing.assert_categorical_equal: Parameter "obj" description should finish with "."
pandas.testing.assert_extension_array_equal: Parameter "left" description should finish with "."
pandas.testing.assert_extension_array_equal: Parameter "right" description should finish with "."
pandas.testing.assert_interval_array_equal: Parameter "obj" description should finish with "."
pandas.testing.assert_sp_array_equal: Parameter "check_fill_value" description should finish with "."
pandas.eval: Parameter "truediv" description should finish with "."
pandas.PeriodIndex: Parameter "freq" description should finish with "."
pandas.core.window.rolling.Rolling.apply: Parameter "engine" description should finish with "."
pandas.core.window.rolling.Rolling.apply: Parameter "engine_kwargs" description should finish with "."
pandas.core.window.expanding.Expanding.apply: Parameter "engine" description should finish with "."
pandas.core.window.expanding.Expanding.apply: Parameter "engine_kwargs" description should finish with "."
pandas.core.groupby.DataFrameGroupBy.corr: Parameter "method" description should finish with "."
```
cool, feel free to any of the remaining ones if you want
TST: Add test for col names during groupby().agg()
State: closed

Column names should consistently be retained when using df.groupby().agg()

- [x] closes #42332
- [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

Whats new:
Add a test to `pandas/tests/groupby/aggregate/test_aggregate.py`

The issue appears to be fixed now:

Tested on 1.4.0.dev0+508.g5fe02971f8

![Screenshot from 2021-08-27 00-06-24](https://user-images.githubusercontent.com/18680207/131070259-ac3d10f2-353c-4872-ba65-2a35abf37b51.png)

Output of `pd.show_versions()`

INSTALLED VERSIONS
------------------
commit           : 5fe02971f8bc40a6bbb742f1f376b3650c3c8eaa
python           : 3.9.5.final.0
python-bits      : 64
OS               : Linux
OS-release       : 5.11.0-31-generic
Version          : #33-Ubuntu SMP Wed Aug 11 13:19:04 UTC 2021
machine          : x86_64
processor        : x86_64
byteorder        : little
LC_ALL           : None
LANG             : en_CA.UTF-8
LOCALE           : en_CA.UTF-8

pandas           : 1.4.0.dev0+508.g5fe02971f8
numpy            : 1.20.3
pytz             : 2021.1
dateutil         : 2.8.2
pip              : 20.3.4
setuptools       : 57.4.0
Cython           : 0.29.24
pytest           : 6.2.4
hypothesis       : 6.14.9
sphinx           : 4.1.2
blosc            : 1.10.4
feather          : None
xlsxwriter       : 3.0.1
lxml.etree       : 4.6.3
html5lib         : 1.1
pymysql          : None
psycopg2         : None
jinja2           : 3.0.1
IPython          : 7.26.0
pandas_datareader: None
bs4              : 4.9.3
bottleneck       : 1.3.2
fsspec           : 2021.05.0
fastparquet      : 0.7.1
gcsfs            : 2021.05.0
matplotlib       : 3.4.3
numexpr          : 2.7.3
odfpy            : None
openpyxl         : 3.0.7
pandas_gbq       : None
pyarrow          : 5.0.0
pyxlsb           : None
s3fs             : 2021.05.0
scipy            : 1.7.1
sqlalchemy       : 1.4.23
tables           : 3.6.1
tabulate         : 0.8.9
xarray           : 0.18.2
xlrd             : 2.0.1
xlwt             : 1.3.0
numba            : 0.54.0

Labels:
name: Testing
description: pandas testing functions or related to the test suite
name: Groupby
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.
> 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.

Sorry, yes I am still interested in working on this
Appears this PR has been dormant for a while and still needs updates so closing. If interested in continuing, please merge master, address related comments and we can reopen.
DOC: Update minimum pip version
State: closed

- [ ] closes #42745 
- [ ] 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: Build
description: Library building on various platforms
name: Docs

Comments:
thanks @lithomas1