BrandonFors/pandas-github-issues huggingface dataset:
Coding Style Guidline.rst
State: closed

Created a unified version of the Coding Style Guidelines
Extracted rules from various pandas website information as well as submission scripts that verify style requirements
Work in progress

- [x] closes #33851
- [ ] tests added / passed
- [ ] passes `black pandas`
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry


Labels:
name: Docs
name: Stale

Comments:
This just duplicates what is already on the docs right? If so I think can just update the existing contributing guide with links rather than a new file with copied content
> 
> 
> This just duplicates what is already on the docs right? If so I think can just update the existing contributing guide with links rather than a new file with copied content

This doesn't just copy what is in the docs. 

This is just the start of the doc and I did pull information scattered in multiple locations about coding guidelines. I also started to pull out checks that are done in the script that check for coding guidelines that are not described anywhere. 

If this document becomes more robust it think that it would be a useful tool for the OSS project.
I am also unsure of how to fix the CI/Checks error. It is saying there is a trailing white space after all my lines which do no show up in my IDE
@WillAyd I'll trim those out and resubmit, thank you for your help! 
@WillAyd I have updated those sections. Let me know if there is anything else that I could research/add
@WillAyd I am also unsure of how to get past the CI / Checks portion of the pull request. It is saying there is a trailing white space after every line but in my IDE this is not there.
The section on `repr` can probably go, since we mostly use fstrings now.
@Stockfoot still active? If so can you simplify and address comments?
@WillAyd I am still around.
I am just unsure of how to proceed. The CI/Check seems to fail no matter what I do.
I have made all the changes that were previously suggested. The only one I need to address is the most recent with @jbrockmendel 
> The section on repr can probably go, since we mostly use fstrings now.


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.
@arw2019 I am interested in continuing. I have addressed the comments but no one has ever responded back to my question on how to proceed and actually get a pull request going. 

Every time I try and submit it will no pass CI / Checks and am unsure how to proceed...

![image](https://user-images.githubusercontent.com/36280534/98286417-37007e00-1f61-11eb-9bc5-4636207c2abc.png)



Can you merge master again and I'll take a look (output from the last build is no longer available for inspection). Some failures are random but we want to make sure otherwise will have to address

Also I might be wrong but I don't think you responded to https://github.com/pandas-dev/pandas/pull/34608/files#r440389770
Closing for now. @Stockfoot let us know whenever you'd like to pick this up and we'll reopen
PERF: isinstance ABCIndexClass and ABCExtensionArray
State: closed

```
%timeit isinstance(pd.Series, pd.core.dtypes.generic.ABCIndexClass)
# 607 ns ± 12.4 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each) - PR
# 937 ns ± 37.5 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each) - Master


%timeit isinstance(pd.Series, pd.core.dtypes.generic.ABCExtensionArray)
# 634 ns ± 26.9 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each) - PR
# 759 ns ± 40.6 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each) - Master


%timeit isinstance(pd.Series, pd.core.dtypes.generic.ABCSeries)
# 638 ns ± 49.1 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each) - PR
# 644 ns ± 20.1 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each) - Master
```

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

Comments:
Nice
Thanks!
DOC: updated io/pytables.py to fix PR08
State: closed


Labels:
name: Docs
name: IO HDF5
description: read_hdf, HDFStore

Comments:
Hello @willpeppo! Thanks for updating this PR. We checked the lines you've touched for [PEP 8](https://www.python.org/dev/peps/pep-0008) issues, and found:



There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers: 

##### Comment last updated at 2020-06-05 16:53:32 UTC
@datapythonista 
thanks @willpeppo
DOC: Fixed docstring in Series .isin() method
State: closed

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


Labels:
name: Docs

Comments:
Changed the docstring in `Series.isin()` (`def isin(self, values) -> "Series":`)
from 

> Check whether `values` are contained in Series.

to 

> Whether elements in Series are contained in 'values'.
Thanks, @mariadelmarbibiloni
BUG: Pandas changes dtypes of columns when no float (or other) assignments are done to this column #34573
State: closed

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


Labels:
name: Bug
name: Indexing
description: Related to indexing on series/frames, not to indexes themselves
name: Dtype Conversions
description: Unexpected or buggy dtype conversions

Comments:
thanks @simonjayhawkins
BUG: fix Series.where(cond) when cond is empty
State: closed

- [ ] closes #34592
- [ ] tests added / passed
- [ ] passes `black pandas`
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry

xref #21947 for fix for DataFrame.where


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

Comments:
thanks @simonjayhawkins
Improve document for **kwargs argument of pandas.DataFrame.to_markdown
State: closed

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


Labels:
name: Docs

Comments:
Sorry thought Tom implemented the to_markdown but looks like it was @MarcoGorelli - does this look good to you?
> Sorry thought Tom implemented the to_markdown but looks like it was @MarcoGorelli

Well, it was me but with the core team holding my hand through the process :)

> does this look good to you?

LGTM, tried building it and the link works as expected
Great thanks @nuka137
DOC: updated base.py and datetimes.py in core/indexes for PR08
State: closed


Labels:
name: Docs

Comments:
Hello @willpeppo! Thanks for updating this PR. We checked the lines you've touched for [PEP 8](https://www.python.org/dev/peps/pep-0008) issues, and found:





There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers: 

##### Comment last updated at 2020-06-05 05:11:37 UTC
Thanks @willpeppo
REF: mix PeriodPseudoDtype into PeriodDtype
State: closed

This will allow us to start getting rid of `get_freq_code` usages and related libfrequencies functions that are unnecessarily roundabout.

Labels:
name: Period
description: Period data type

Comments:
looks good. slightly concerned about the UNDEFINED case (e.g. we don't assert this anywhere)........
> slightly concerned about the UNDEFINED case

It also shows up in period.pyx as FR_UND (xref #34588), so i dont think we'll be able to get rid of it, but we should at least be able to get to a point with _fewer_ of these enum-like codes lying around
DataFrame.truncate drops MultiIndex names
State: closed

- [x] closes #34564
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry
- [x] added tests
- [ ] passes tests (fixed for `DataFrame`, still issue for `Series`)

Labels:
name: Bug
name: Indexing
description: Related to indexing on series/frames, not to indexes themselves
name: MultiIndex

Comments:
Thanks @arw2019 

Could you add a test to show how this fixes the linked issue?
> Could you add a test to show how this fixes the linked issue?

@MarcoGorelli Added the test just now. It's currently inside `pandas/tests/indexing/multiindex/test_slice.py` but I'll move it if there's a better location for it!

As an aside, I looked in both `pandas/pandas/tests/indexes` and  `pandas/pandas/tests/indexing` and I couldn't find any other tests for `DataFrame.truncate`. Either here or in a separate pull request I'd be happy to add additional tests if people think it's a good idea!
thanks @arw2019
ENH: Resolutions for month/qtr/year
State: closed

This does three things

1) Use Resolution objects instead of strings in the places in core.indexes.  This makes whats going on much clearer.
2) To make 1) possible, extend Resolution to include month, quarter, and year.  This means that `pd.period_range("2017", periods=3, freq="A").resolution` is now "year" instead of "day", which is more accurate.
3) with year/quarter/month added, `Resolution` and `FreqGroup` will be re-labellings of each other, so we can de-duplicate them.  They will end up living in tslibs.dtypes.

Labels:
name: Frequency
description: DateOffsets

Comments:
Hello @jbrockmendel! Thanks for updating this PR. We checked the lines you've touched for [PEP 8](https://www.python.org/dev/peps/pep-0008) issues, and found:













There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers: 

##### Comment last updated at 2020-06-09 21:06:34 UTC
Some questions:

- To be able to de-duplicate with FreqGroup, wouldn't you also need to add weekly and business-day resolution?
- Since resolution is used for string datetime indexing, how does this change affect that (or not) ?
> To be able to de-duplicate with FreqGroup, wouldn't you also need to add weekly and business-day resolution?

Yep, oversight on my part.  Weekly we could reasonably add to Resolution, but Business makes less sense.  De-duplication may not be viable after all.

> Since resolution is used for string datetime indexing, how does this change affect that (or not) ?

It does not affect the behavior.  Adding the month/quarter/year resos is what allows us to use Resolution objects in the relevant indexing code without changing any behavior.
rebased+green
thanks!
DOC: DataFrame.reindex improve summary and return type
State: closed

- [x] closes #33888 
- [x] tests added / passed (passes `scripts/validate_docstrings.py pandas.DataFrame.reindex`)
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry (Not Required)

Labels:
name: Stale

Comments:
Hello @gauravchandok! Thanks for updating this PR. We checked the lines you've touched for [PEP 8](https://www.python.org/dev/peps/pep-0008) issues, and found:



There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers: 

##### Comment last updated at 2020-06-06 21:18:56 UTC
While I'm reading your changes I realized there is more to this confusion than just the docstring. See #34663. The behavior of `copy` is confusing in my opinion. We probably need to address that first. 

At the moment, I don't think this PR explains its behavior accurately. Let's discuss in #34663 what the desired outcome should be, which could be to deprecate `copy`. After that you can continue working on this PR or open a new PR to achieve that.
@gauravchandok Can you merge master to fix conflicts?
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.
@gauravchandok Can you address comments and merge master?
Closing for now. @gauravchandok ping us whenever you'd like to continue and we'll reopen!
TST: series offset artithmetic tests
State: closed

…racting a series of DateOffsets to / from a series of Timestamps (test_series_add_daytime_offset, test_series_add_daytime_offset)

- [x] closes #19211
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry (omitted, test only)


Labels:
name: Testing
description: pandas testing functions or related to the test suite
name: Datetime
description: Datetime data dtype
name: Numeric Operations
description: Arithmetic, Comparison, and Logical operations

Comments:
@dsaxton / @jbrockmendel 
Any further comments?
I'm stepping away for a little while, maybe @jorisvandenbossche or @TomAugspurger can take a look.
On master I see a PerformancWarning with the original example. We'll need to make sure that doesn't leak through in the tests.
is this still a draft? and can you address @TomAugspurger comment, e.g. we may want to see where the PerformanceWarning are coming from
can u merge master and update
closing as user is ghost
solves ci issues with #34575
State: closed

- [x] closes #34575 
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
solved issues with benchmarks
benchmarks running fine now

Current right output
```
· Discovering benchmarks
· Running 1 total benchmarks (1 commits * 1 environments * 1 benchmarks)
[  0.00%] ·· Benchmarking existing-py_home_moha_venv_pandas-dev_bin_python
[ 50.00%] ··· arithmetic.ApplyIndex.time_apply_indexgit                                                                                                ok
[ 50.00%] ··· =================================== ==========
                             offset                         
              ----------------------------------- ----------
                      <YearEnd: month=12>          2.05±0ms 
                      <YearBegin: month=1>         1.56±0ms 
                 <QuarterEnd: startingMonth=3>     4.41±0ms 
                <QuarterBegin: startingMonth=3>    2.50±0ms 
                           <MonthEnd>              4.32±0ms 
                          <MonthBegin>             2.31±0ms 
                 <DateOffset: days=2, months=2>    5.67±0ms 
                         <BusinessDay>             10.4±0ms 
                <SemiMonthEnd: day_of_month=15>    14.5±0ms 
               <SemiMonthBegin: day_of_month=15>   14.2±0ms 
              =================================== ==========
```

Labels:
name: CI
description: Continuous Integration
name: Frequency
description: DateOffsets

Comments:
thanks @hasnain2808 ping on green; we can merge this to patch short term.
ping
Solve ci issue related to #34555
State: closed

- [x] closes #34575 
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
solved issues with benchmarks
benchmarks running fine now

Current right output
```
· Discovering benchmarks
· Running 1 total benchmarks (1 commits * 1 environments * 1 benchmarks)
[  0.00%] ·· Benchmarking existing-py_home_moha_venv_pandas-dev_bin_python
[ 50.00%] ··· arithmetic.ApplyIndex.time_apply_indexgit                                                                                                ok
[ 50.00%] ··· =================================== ==========
                             offset                         
              ----------------------------------- ----------
                      <YearEnd: month=12>          2.05±0ms 
                      <YearBegin: month=1>         1.56±0ms 
                 <QuarterEnd: startingMonth=3>     4.41±0ms 
                <QuarterBegin: startingMonth=3>    2.50±0ms 
                           <MonthEnd>              4.32±0ms 
                          <MonthBegin>             2.31±0ms 
                 <DateOffset: days=2, months=2>    5.67±0ms 
                         <BusinessDay>             10.4±0ms 
                <SemiMonthEnd: day_of_month=15>    14.5±0ms 
               <SemiMonthBegin: day_of_month=15>   14.2±0ms 
              =================================== ==========
```

Labels:

Comments:
This is a mistake closing it
TST: Added test to check that the freqstr attribute of the index is p…
State: closed

…reserved after a shift operation. Run black and flake8.

- [x] closes #21275
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry (omitted, test only)


Labels:
name: Testing
description: pandas testing functions or related to the test suite
name: Datetime
description: Datetime data dtype
name: Frequency
description: DateOffsets

Comments:
thanks @KD-dev-lab
Export InvalidIndexError
State: closed

- [x] closes #xxxx (there is no such an issue)
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry


Labels:
name: Error Reporting
description: Incorrect or improved errors from pandas

Comments:
@horta  there is a `pandas.errors` submodule where this could be put instead of at the top-level namespace
I have now defined `InvalidIndexError` at `pandas.errors` module. Documented it (suggestions?). Most of the diff concerns importing `InvalidIndexError` from `pandas.errors`.
Could you include this error in the API reference? https://pandas.pydata.org/docs/reference/general_utility_functions.html#exceptions-and-warnings
@horta looks fine, can you rebase and update to the comments above, ping on green.
> Could you include this error in the API reference? https://pandas.pydata.org/docs/reference/general_utility_functions.html#exceptions-and-warnings

Done.
lgtm ping on green.
BUG: Fix na_rep when using pd.NA in _format_strings (#33950)
State: closed

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


Labels:
name: Output-Formatting
description: __repr__ of pandas objects, to_string
name: IO HTML
description: read_html, to_html, Styler.apply, Styler.applymap
name: Stale

Comments:
@k-fillmore thanks for the contribution!

Does this keep the correct `"<NA>" `representation by default? (when not using `na_rep` keyword)

Further, can you add a test for this?
Hi, @jorisvandenbossche  Doesn't appear to retain the "" representation.  I've added an additional expression to address this. Working on tests. 
Hello @k-fillmore! Thanks for updating this PR. We checked the lines you've touched for [PEP 8](https://www.python.org/dev/peps/pep-0008) issues, and found:





There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers: 

##### Comment last updated at 2020-06-05 22:52:41 UTC
@jorisvandenbossche added tests. Don't really like the leading whitespace that I had to add. But that's how they're being passed back from GenericArrayFormatter. I tried to track down where they're coming from but didnt have much luck. Any ideas? 
Just want to follow up on this. Do I need to add anything else? 
https://github.com/pandas-dev/pandas/issues/33950#issuecomment-680406172 noted that this affects NaT too. Can you fix that here or open a second issue?
Can you also merge master and re-push. I don't know why CI failed last time. We also need a release note in whatsnew/1.2.0.rst.
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.
Noted, working on NaT here. Will do a merge master and add change logs as requested. 
Closing for now. @k-fillmore let us know whenever you'd like to continue and we'll reopen!
CLN: circular/runtime imports in tslibs
State: closed

ATM tzconversion depends on timedeltas (for delta_to_nanoseconds), which throws a wrench in the erstwhile dependency hierarchy.  By making the one usage of delta_to_nanoseconds a runtime import, we make it possible to remove a bunch of other runtime imports.

Labels:
name: Clean

Comments:
ok fair, but we should document this somewhere i think.
DOC: Fixed PR06 (wrong parameter type) in pandas.Timestamp
State: closed


Labels:
name: Docs

Comments:
@willpeppo Your change looks right, but I think you also need to make the corresponding change in pandas/_libs/tslibs/nattype.pyx to get CI to pass
Dan- thank you for the feedback!   I decided over the weekend to make my first oss contribution and have been wrestling through it the past few days.  I really appreciate the comment.  How did you determine that btw ? 
> Dan- thank you for the feedback! I decided over the weekend to make my first oss contribution and have been wrestling through it the past few days. I really appreciate the comment. How did you determine that btw ?

No problem, thanks for the contribution. You can see what's wrong by clicking the "Details" next to one of the failed pipelines, for example: https://github.com/pandas-dev/pandas/pull/34561/checks?check_run_id=736430284.

It shows that two tests failed and you can take a look at the logs by clicking "View more details on Azure Pipelines" and going to "Tests". There you can look for an error message and by thinking through what's being tested figure out how to fix the issue.
Thanks @willpeppo for the contribution, and @dsaxton for the review!
DOC: Add bcpandas to Ecosystem in docs
State: closed

- [ ] closes #xxxx
- [ ] tests added / passed
- [ ] passes `black pandas`
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry

Hi, I wrote this utility which I use in production almost daily at my job, and it's been super helpful for me personally to fill a gap - slow writes from Pandas to MS SQL. Figured I'd suggest it in the pandas ecosystem if it could be useful to others.

Wasn't sure where to put it, and didn't want to start a new section, so I put it in `Out-of-core`. It appeared to be sorted alphabetically, so I put it in that order.


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

Comments:
Just made those changes thanks
@yehoshuadimarsky can you update to @jorisvandenbossche comments, otherwise lgtm.
@jreback ok just did, thanks
thanks @yehoshuadimarsky
Ci #34131 rm slow fixtures
State: closed

- [ x ] Part of #34131 
- [ x ] passes `black pandas`
- [ x ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ FAIL ] tests passed for 11 of 12 files changed. 6 tests fail inside the file `pandas/core/arrays/datetimes.py` , but there are not concerned by this PR. So I decide to push anyway.

I went through tests tagged with `@pytest.mark.slow` and take a look at the duration. The test is unmarked if the test duration is below 1 second.
note: I considered the total time for each combination in case of parameters

A total of 76 flags `slow` were unmark, so we can focus on "real" slow tests.




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

Comments:
for future reference, lets refer to these as `pytest.mark.slow`, since they're not technically fixtures
looks like some of the failing tests need a td.skip_if_no_scipy decorator
@OlivierLuG aplaud the effort here. this is a bit tricky because IIRC we only run the slow on a single job (on travis); the issue is that *some* of these tests are marked slow not to indicate they are slow but rather that we want to run them there, e.g. plotting tests and such. 

we have a pretty tricky setup with this, so you will have to play with the ci to get this to pass.

you might want to start with a smaller scope (e.g. start with x tests), then get it passing, then keep adding.
Thanks for the explaination. If I do understand correctly, the objective of this issue is either to unmark the slow tests, and still passing the CI tests or to optimise the speed of the tests itself ?
i think a good start here would be to fix some of the really slow tests themselves 

also the original issue was about some fast tests that are actually slow on ARM