BrandonFors/pandas-github-issues huggingface dataset:
DOC: updated documentation for BusinessHour and BusinessDay
State: closed

This PR is related to PR #50182.
- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).

Updated documentation for `BusinessDay`, `BusinessHour`, `CustomBusinessHour`. Corrected lists of parameters and provided more examples.
Could you, please, @MarcoGorelli, review my PR?


Labels:
name: Docs

Comments:
> Thanks for working on this @natmokval ! Got some minor comments, but overall this is a nice improvement

Thank you @MarcoGorelli, I like doing it. I find the idea of slightly improving the documentation of offsets reasonable.

Agreed, I did copy-and-paste this example from CustomBusinessHour. The PR is updated as you suggested.
> Almost there 💪
> 
> There's some CI failures from the docstring validation script, check https://github.com/pandas-dev/pandas/actions/runs/3707564825/jobs/6284132896

Thank you MarcoGorelli, for your help. I checked the errors raised by the docstring validation script in CI and fixed them. It's interesting, why if I run the docstring validation script locally these errors don't occur.

> I checked the errors raised by the docstring validation script in CI and fixed them. It's interesting, why if I run the docstring validation script locally these errors don't occur.

My guess is that you hadn't re-compiled your C extensions (`python setup.py build_ext`) - you'll need to do that any time you modify `.pyx` files (as you did here, or as can happen when you fetch and merge upstream/main)
Thank you MarcoGorelli, for your comment. Usually, I run `python setup.py build_ext -j 1 `, `python -m pip install -e . --no-build-isolation --no-use-pep517`and smth like `python scripts/validate_docstrings.py pandas.offsets.BusinessDay` after modifying  .pyx files. Otherwise, html won’ be rebuilt.
Probably this time I missed something.

On the other hand, when I tried to reproduce my mistake, I run `python setup.py build_ext -j 1 --force`, and then 
the docstring validation script raised my error. Maybe it would be better to use `--force` while re-compiling the C extensions.

if you just do `python setup.py build_ext`, then only the files that have changed since you last compiled will be recompiled, whereas `--force` recompiles everything - usually the first one's fine (it's what I usually do), but occasionally things go wrong and I have to use `--force`. hopefully the meson build will make this work a lot better - there's a PR open for that, don't know how far away it is from being ready though
REGR: to_datetime with non-ISO format, float, and nan fails on main
State: closed

- [ ] closes #50237 (Replace xxxx with the GitHub issue number)
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.


Labels:
name: Datetime
description: Datetime data dtype
name: Regression
description: Functionality that used to work in a prior pandas version

Comments:
Owee, I'm MrMeeseeks, Look at me.

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

1. Checkout backport branch and update it.

```
git checkout 1.5.x
git pull
```

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

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

```
git commit -am 'Backport PR #50238:  REGR: to_datetime with non-ISO format, float, and nan fails on main'
```

4. Push to a named branch:

```
git push YOURFORK 1.5.x:auto-backport-of-pr-50238-on-1.5.x
```

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

> "Backport PR #50238 on branch 1.5.x ( REGR: to_datetime with non-ISO format, float, and nan fails on main)"

And apply the correct labels and milestones.

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

Remember to remove the `Still Needs Manual Backport` label once the PR gets merged.

If these instructions are inaccurate, feel free to [suggest an improvement](https://github.com/MeeseeksBox/MeeseeksDev).
DEPR: deprecate Index.is_floating
State: closed

- [ ] progress towards https://github.com/pandas-dev/pandas/issues/50042
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [x] Added an entry in the latest `doc/source/whatsnew/v2.0.0.rst` file if fixing a bug or adding a new feature.



Labels:
name: Deprecate
description: Functionality to remove in pandas
name: Index
description: Related to the Index class or subclasses

Comments:
@topper-123  Hi, Can you check if I have done right?
Can you tell me the next step I should do?
thx @yuuun
BUG: warning shown when parsing delimited date string even if users can't do anything about it
State: closed

- [ ] closes #50231  (Replace xxxx with the GitHub issue number)
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.


Labels:
name: Datetime
description: Datetime data dtype
name: Warnings
description: Warnings that appear or should be added to pandas

Comments:
are there any contexts where we _do_ want to issue a warning?
I wouldn't think so, because users can't pass `format` nor `dayfirst` to Timestamp

If anything, maybe Timestamp should become stricter and only accept iso8601 strings?
> I wouldn't think so, because users can't pass format nor dayfirst to Timestamp

i meant more along the lines of if the warning should be issued when we are parsing sequences.  (so it would need to be issued somewhere else presumably)
Timestamp doesn't accept sequences, and to_datetime already warns - I've probably misunderstood though, is there another path that accepts sequences that might get here? I'll check more carefully tomorrow
> and to_datetime already warns

wasnt aware of that.  all good here.
> If anything, maybe Timestamp should become stricter and only accept iso8601 strings?

id be OK with more strict than the status quo (problems have been caused by the parsing code accepting "t2m", though Timestamp still rejects that as OOB for nanosecond reso).  iso8601-only is probably too strict for my tastes

long long ago i wrote a dateutil-like parser that passed all/most of the dateutill tests and IIRC it was mostly just a handful of regexes (and appreciably more performant).  ill see if i can dig that up.
> > and to_datetime already warns
> 
> wasnt aware of that. all good here.

thanks! merging then
Revert "CI: Pin pyarrow smaller than 10 (#50055)"
State: closed

This reverts commit 4c5db2e435d13c5ca91f98d07edde18a498ae6dd.

- [ ] closes #xxxx (Replace xxxx with the GitHub issue number)
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.

Checking if we can unpin arrow now

Labels:

Comments:
the crircleci failure seems legit
DEPR: deprecate Index.is_object
State: closed

- [ ] progress towards https://github.com/pandas-dev/pandas/issues/50042
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.


Labels:
name: Stale

Comments:
@topper-123 Do you know what I got wrong? I have looked at some other pull requests, but they have both common and different files to fix. Actually, I am not sure how to detect which file I should change is_object to is_object_dtype. Do you have any suggestion for me?
Hi @bang128 I think you're getting quite close. The issues that I see are:

1: doc/source/whatsnew/v2.0.0.rst
There are some artifacts in `doc/source/whatsnew/v2.0.0.rst` likely from a git rebase. Can you fix those.

2: failures
In general you need to go through the test logs above (click the "details" button) to see which errors have been raised. I can see these, which need to be fixed in one test log:

```
FAILED pandas/tests/series/methods/test_describe.py::TestSeriesDescribe::test_numeric_result_dtype[complex] - TypeError: a must be an array of real numbers
FAILED pandas/tests/series/methods/test_describe.py::TestSeriesDescribe::test_numeric_result_dtype[complex64] - TypeError: a must be an array of real numbers
FAILED pandas/tests/series/methods/test_describe.py::TestSeriesDescribe::test_numeric_result_dtype[complex128] - TypeError: a must be an array of real numbers
```

Looks like something related to the treatment of complex numbers. I'm not able to run these tests right now, but if you could attempt to solve them, I can take a closer look tonight and help you fix them, if you haven't been able to before.

There may be others, I haven't checked all test failures.
Hi @bang128  can you try to fix the issues in `doc/source/whatsnew/v2.0.0.rst` and push again. I think that may be enough to fix this.

Regarding how to find the instances to correct, you should run the pandas test suite locally and fix errors that show up. Depending on your coding proficiency, this may not be entirely trivial, but it'll be a good learning exercise in any case :-)  
Okay, let me try to fix the doc issue first


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.
Hi @bang128. What's the status on your PR?

It look good to me, but needs a rebase. 


Can you rebase.
Ping. Should I rebase for you?
Hey @bang128 , the rebase was a bit difficult, so I’ve rebased & merged this. Thanks a lot for yoyr contribution!
BUG: DataFrame reductions with object dtype and axis=1
State: closed

- [x] closes #49603 (Replace xxxx with the GitHub issue number)
- [x] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [x] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [x] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.

In #49616 I attempted to only remove the errant cast to float, but this lead to the issue that, e.g. for axis=1 the sum of boolean columns becomes object. Unconditionally taking the block manager reduce path solves this problem, but then we run into the issue of taking a transpose of a frame with no columns (see the comments in the diff here). This PR resolves that issue, but is a bit of a hack (I can't seem to find any other resolution).

In the test here, there are some reductions (e.g. mean) that one may have expected float back instead - I've opened #49618 for this.

Labels:
name: Dtype Conversions
description: Unexpected or buggy dtype conversions
name: DataFrame
description: DataFrame data structure
name: Stale
name: Reduction Operations
description: sum, mean, min, max, etc.

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 in favor of #51335
DEPR: deprecate Index.is_categorical
State: closed

- [ ] progress towards https://github.com/pandas-dev/pandas/issues/50042
- [x] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [x] Added an entry in the latest `doc/source/whatsnew/v2.0.0.rst` file if fixing a bug or adding a new feature.


Labels:

Comments:
@topper-123 Does this one seem ok as well?
You need to make the test suite pass, prpbably there’s some usage if this method in the code  base. Ping when you make it pass.
REF: use astype_array instead of astype_nansafe
State: closed

Trying to ensure we have only one astype behavior.

The BaseParser change _could_ change behavior if we can get there with dt64/td64 data (that includes at least one NaT) and an integer dtype, but we don't have any test cases that get there with dt64/td64 and it isn't clear to me if it is possible.  If it is, the non-raising behavior here is more consistent with our other behavior.

Labels:
name: Refactor
description: Internal refactoring of code
name: Dtype Conversions
description: Unexpected or buggy dtype conversions

Comments:
Thanks @jbrockmendel
Initialize row data frame with list
State: closed

[X ] closes #48479(Replace xxxx with the GitHub issue number)
[ X] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
[ X] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
 Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
New Feature
It is now possible to initialize a dataframe with a list.

A parameter was also created that allows choosing the direction in which the list will be inserted in the dataframe when initializing it. By column or row.

Here are some examples:

EX1: direction parameter was not set and index parameter was
list_data = [1,2,3,4]
list_columns = ["a","b","c","d"]
result = pd.DataFrame(data=list_data,columns=list_columns,index=[5])

Result:
a b c d
5 1 2 3 4

EX2: direction parameter set as column

list_data = ["x","y","z","k"]
list_columns = ["a","b","c","d"]
pd.DataFrame(data=list_data,columns=list_columns,direction=["columns","b"])

Result:
a b c d
0 NaN NaN x NaN
1 NaN NaN y NaN
2 NaN NaN z NaN
3 NaN NaN k NaN

Labels:

Comments:
https://github.com/pandas-dev/pandas/issues/48479
The underlying issue was never picked up by core devs. Im also -1 for this I'm afraid.
Thanks for the pull request, but unfortunately, the feature hasn't gotten enough support from the core devs. If you are interested in contributing, I would recommend searching for issues labeled `good first issue`. Closing
ENH: handle nonexistent shift for ZoneInfo
State: closed

- [ ] closes #xxxx (Replace xxxx with the GitHub issue number)
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.


Labels:
name: Timezones
description: Timezone data dtype

Comments:
Thanks @jbrockmendel
ENH: implement Float16Engine
State: closed

cc @topper-123 

If we do go down this path, I'll try to fix the xfails before merging.

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

Comments:
context is #49536, this is largely a proof of concept
I don't have a string opinion on 16bit floats, they're probably very rarely used, that most users won't use them, thought from a API completeness perspective, they're good to have. So I'm probably +0 on adding float16 indexes. 

IF it is decided to go through with this,  float16 should be added to `pandas/tests/indexes/numeric/test_numeric.py::TestFloatNumericIndex::dtype` and probably in other places.
I'm pretty happy to defer to @topper-123 on this topic.  should we close this?
I would very much would like #49536 to get merged, i.e. so I'm in favor of closing this for now, or at least not having #49536 dependant on this PR. If someone wants float16 indexes, it can always be opened a new PR later (though I'm a bit apprehensive about if because of the lack of `float16_t` in numpy).

I'll close this PR for now.
REF: de-duplicate period-dispatch
State: closed

@phofl you should be able to re-use with _accumulate to fix the PeriodDtype-with-Nat case

Labels:
name: Refactor
description: Internal refactoring of code

Comments:
```
pandas/core/arrays/datetimelike.py:1554: error: Untyped decorator makes function "_quantile" untyped  [misc]
pandas/core/arrays/datetimelike.py:1562: error: Untyped decorator makes function "min" untyped  [misc]
pandas/core/arrays/datetimelike.py:1580: error: Untyped decorator makes function "max" untyped  [misc]
pandas/core/arrays/datetimelike.py:1635: error: Untyped decorator makes function "median" untyped  [misc]
```
Thanks @jbrockmendel
CI minimum mpl version everywhere
State: closed

- [ ] closes #50202  (Replace xxxx with the GitHub issue number)
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.


Labels:
name: CI
description: Continuous Integration

Comments:
thx @MarcoGorelli 
@MarcoGorelli could you look into 1.5.x? We get failures there as well but will need a different min version probably
🤔 don't know, the minimum version is set to 3.3.2 in that branch, and that's exactly what CI is pulling in. will investigate
@meeseeks-dev backport to 1.5.x
@meeseeksdev backport to 1.5.x
WIP Does a smaller env fix CI?
State: closed

- [ ] closes #xxxx (Replace xxxx with the GitHub issue number)
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.


Labels:

Comments:
nope 😢
Fix some dosctring RT02 error
State: closed

- [ ] closes #xxxx (Replace xxxx with the GitHub issue number)
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.


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

Comments:
About #49968 
thx @luke396
API: ensure IntervalIndex.left/right are 64bit if numeric, part II
State: closed

- [ ] closes #xxxx (Replace xxxx with the GitHub issue number)
- [x] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [x] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.

Follow-up to #50130. It turned out that `IntervalArray.from_array` could get around the 64bit requirement, so we fix that by moving `maybe_convert_numeric_to_64bit` and  and using it in the `IntervalArray` constructor also. 

Also return the 64bit index in `IntervalIndex._maybe_convert_i8`, previously we returned `original`, which was the  not-64bit-converted one...(this changes a test, but it’s just for an internal method).

Labels:
name: Interval
description: Interval data type

Comments:
Sorry for the late response, I had some things I had to attend to in the weekend.

I respond to you comments individually above. I did look into this again and agree that some of the suggestions in my original PR could be improved upon (especially the changes to `ÌntervalArray`) and I've uploaded a new version (with rebase).
The failed check is unrelated. 
Rebased to make the CI run again. No other changes have been made.
Ping.

As far as I see all comments have been addressed?
👍 I've remove that code section.
Ping. I've rebased because this has been standing still for a bit.
thx @topper-123
ENH: Added string_as_repr method
State: closed

Adresses the issue #46744

The issue's author suggested creating a new module for this function/method, however, I think it is not a viable solution for a contributor to do. Instead, I added this method to string.py, however, I'm not sure if that's the right place for it to be added. 

Labels:

Comments:
Agreed. I think this needs a bit more discussion before moving forward so closing for now