BrandonFors/pandas-github-issues huggingface dataset:
BUG: fix DataFrame(data=[None, 1], dtype='timedelta64[ns]') raising ValueError
State: closed

- [x] closes #60064(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.
- [x] 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: Timedelta
description: Timedelta data type
name: Constructors
description: Series/DataFrame/Index/pd.array Constructors

Comments:
The problem comes from the branch `elif is_float_dtype(data.dtype):` in function `sequence_to_td64ns`.
https://github.com/pandas-dev/pandas/blob/68d9dcab5b543adb3bfe5b83563c61a9b8afae77/pandas/core/arrays/timedeltas.py#L1114
`data` here is a 2D `array([[nan], [ 1.]])`.
But `cast_from_unit_vectorized` only accepts 1D array as input, thus producing the "Buffer has wrong number of dimensions" error (see [issue](https://github.com/pandas-dev/pandas/issues/60064#issuecomment-2428159736)), if I understand correctly the code below:
https://github.com/pandas-dev/pandas/blob/68d9dcab5b543adb3bfe5b83563c61a9b8afae77/pandas/_libs/tslibs/conversion.pyx#L133-L147

I notice that other branches for other dtypes in `sequence_to_td64ns` can work with 2D array data, so come up with this quick fix.

CI should be fixed now. Can you merge main.

> CI should be fixed now. Can you merge main.

Thanks. I merged main and added in whatsnew.
> But cast_from_unit_vectorized only accepts 1D array as input

My preference ideally would be to make cast_from_unit_vectorized correctly handle 2D inputs.  Handling it in _try_cast seems like a fine second-best.
Merge when ready @rhshadrach 
Friendly ping @rhshadrach 
Thanks @yuanx749!
FIX: Resolve KeyError with LaTeX headers in to_latex method
State: closed

- [x] closes #60063 
- [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.
- [ ] 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:
This is not a sensible fix. It is a hard coded direct string replacement for the exact issue presented. What about the flip case where the user actually wants to display what they have input and **don't** expect it to be directly replaced by your fix?

I will take a look at the underlying issue but I am not entirely convinced it even warrants a fix yet.
Yeah you are right. I did not consider this case. Thank you for your feedback.
Appears it may be too early to submit a PR at this point so closing
Delete exception from pandas frame
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:
Thanks for the PR but it's not clear what this PR is addressing; I would suggest reviewing https://pandas.pydata.org/pandas-docs/stable/development/contributing_codebase.html before opening a PR so closing
Testing 
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:
It's not clear what this PR is addressing, but I would suggest testing PRs on your own repo so closing
DOC: Add Timedelta accepting float value
State: closed

- [x] closes #60044 


Labels:
name: Docs
name: Timedelta
description: Timedelta data type

Comments:
@ZKaoChi , See [the error message for the failed test](https://results.[pre-commit.ci](https://results.pre-commit.ci/run/github/858127/1729081421.P09tMa7sRx2mXWMiXpg8cw)/run/github/858127/1729081421.P09tMa7sRx2mXWMiXpg8cw):

```
cython-lint.............................................................................................Failed
- hook id: cython-lint
- exit code: 1

/code/pandas/_libs/tslibs/timedeltas.pyx:1871:89: E501 line too long (149 > 88 characters)
```

(Keep lines below 89 characters.)
@5j9 I see. Thanks a lot!!!
Thanks @ZKaoChi 
Thanks a lot for your help.
DOC: fixed docstring of timedelta.ceil to match docstring of datetimeindex…
State: closed

This PR fixes the document for pandas Timedelta.ceil.

It also adds summary to pandas Timedelta.ceil, Timedelta.floor and Timedelta.round to pass the [docstring validation](https://pandas.pydata.org/docs/dev/development/contributing_documentation.html#updating-a-pandas-docstring)

- [x] closes #59902 (Replace xxxx with the GitHub issue number)
- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).


Attaching screenshots for changes, tested in local:
<img width="1421" alt="Screenshot 2024-10-16 at 14 02 45" src="https://github.com/user-attachments/assets/e4ae20a7-4ee7-462f-b47a-2fcb6416f450">
<img width="1409" alt="Screenshot 2024-10-16 at 12 48 42" src="https://github.com/user-attachments/assets/68af401d-6b6b-4f12-bd7a-fdb0d129aeec">
<img width="1403" alt="Screenshot 2024-10-16 at 12 48 52" src="https://github.com/user-attachments/assets/c8219cb0-a7ea-47f1-9d1f-acc8f76d1b57">


Labels:

Comments:
Thanks for the PR but appears https://github.com/pandas-dev/pandas/pull/60047 was opened first so let's allow that contributor to address this issue first. Closing but happy to have your help on other issues
Fix Date Parsing Issue in Arrow Parser for CSV Files (#59904)
State: closed

### **Description:**

#### **Overview**
This pull request addresses issue #59904, which involves a failure in date parsing within the `arrow_parser_wrapper` when reading CSV files using the PyArrow engine. The existing implementation encounters problems when processing missing values in the date column, resulting in the column being interpreted as a generic object type rather than a proper datetime type.

#### **Issue Description**
The `read_csv` function in the `arrow_parser_wrapper` was failing to convert the date column to the expected `timestamp[ns][pyarrow]` dtype due to the presence of missing values. The absence of proper handling for these null entries led to the entire date column being inferred as an `object` dtype instead.

#### **Modifications Made**
1. **Enhanced Null Handling**: The code has been modified to incorporate checks for null values during the date parsing process. This ensures that missing entries are accounted for without causing a failure in type inference.
   
2. **Date Parsing Logic**: Adjustments have been made in the `read` method to validate and appropriately convert date columns. The modifications allow the function to return a DataFrame with the correct datetime dtype, even in the presence of missing values.

3. **Testing**: A test case has been added to verify the expected behavior of date parsing when null values are included. This test checks that the date column is correctly interpreted as `timestamp[ns][pyarrow]`, regardless of any missing data.

#### **Expected Behavior**
With these changes, users can expect the following improvements:
- Date columns in CSV files will be accurately parsed to `timestamp[ns][pyarrow]`, ensuring consistent and expected behavior when handling time series data.
- The presence of missing values will no longer disrupt the parsing process, allowing for more robust data ingestion workflows.

#### **Conclusion**
This fix enhances the robustness of the date parsing functionality within the `arrow_parser_wrapper`, addressing the critical issue reported in #59904. The improvements not only solve the immediate problem but also provide a more reliable framework for handling CSV data with PyArrow in future applications.

Labels:

Comments:
@Lavishgangwani - are you still working on this? I can continue this PR thanks
Thanks for the pull request, but it appears to have gone stale. If interested in continuing, please merge in the main branch, address any review comments and/or failing tests, and we can reopen.
BUG: Fix incosistent behavior of 2d-indexed loc-set to Series #59933
State: closed

- [x] closes #59933 
- [x] Tests added and passed
- [x] All code checks passed
- [x] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.

Comments about pull-request:

1. Fixed case with inconsistent behavior of different indexes

``` python
>>> df = pd.DataFrame([[1, 2, 3], [4, 5, 6], [7, 8, 9]], columns=list("ABC"))
>>> df.loc[:, ['A', 'B', 'C']] = pd.Series([10, 20, 30]) 
#before fix
>>> df
    A   B   C
0  10  20  30
1  10  20  30
2  10  20  30
#after fix
>>> df
    A   B   C
0  10  10  10
1  20  20  20
2  30  30  30
```
Inconsistance with case:
``` python
#before and after fix (no changes)
>>> df = pd.DataFrame([[1, 2, 3], [4, 5, 6], [7, 8, 9]], columns=list("ABC"))
>>> df.loc[df['A']>0, ['A', 'B', 'C']] = pd.Series([10, 20, 30]) 
>>> df
    A   B   C
0  10  10  10
1  20  20  20
2  30  30  30

```

2. Fixed initial issue. And now it works consistently with test_multi_assign_broadcasting_rhs like this
``` python
>>> df = pd.DataFrame([[1, 2, 3], [4, 5, 6]], columns=list("ABC"))
>>> df.loc[:, pd.Series(['A', 'B', 'C'])] = pd.Series([10, 20, 30])
#before fix - FAIL
#after fix 
>>> df
    A   B   C
0  10  10  10
1  20  20  20
```
https://github.com/pandas-dev/pandas/blob/05fa9583f7bc22796076b7e2a7b94058bebca511/pandas/tests/indexing/test_indexing.py#L475-L492






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

Comments:
CI is fixed now, can you merge main.
@anzber - test failures look related. Can you also give this PR an informative title? It is helpful to have titles that give devs a sense of what the PR is doing without having to go open the issue.
> @anzber - test failures look related. Can you also give this PR an informative title? It is helpful to have titles that give devs a sense of what the PR is doing without having to go open the issue.

@rhshadrach  added more information to title. Thank You for reviewing the code.
@rhshadrach 
I've found a new problem related the issue

This code fails, but shouldn't :
``` python
df33 = pd.DataFrame([[1, 2, 3], [4, 5, 6], [7, 8, 9]], columns = list("ABC"))
df33.loc[:, pd.Series({"A": True, "B": True, "C": False})] = pd.Series([10, 20, 30])
df33
```
This pull request is stale because it has been open for thirty days with no activity. Please [update](https://pandas.pydata.org/pandas-docs/stable/development/contributing.html#updating-your-pull-request) and respond to this comment if you're still interested in working on this.
Thanks for the pull request, but it appears to have gone stale. If interested in continuing, please merge in the main branch, address any review comments and/or failing tests, and we can reopen.
Reopening (ref: #60621)
@anzber - I see you requested review. It looks like tests are failing. Those will need to be fixed.
> @anzber - I see you requested review. It looks like tests are failing. Those will need to be fixed.

That was not my fault. After merge all tests have passed. 


Thanks @anzber!
docs: add marimo to ecosystem.md
State: closed

We (https://github.com/marimo-team/marimo) have strong support for pandas, so was hoping to showcase that! Thank you for considering this PR

- [ ] 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

Comments:
Thanks @mscolnick
DOC: fix docstring of timedaltas.ceil
State: closed

- [ ] closes #59902
- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).

Labels:
name: Docs

Comments:
I check the function `timedelta.ceil()` and find that only D,H,min,s,ms,us,ns are valid inputs but maybe more like 'm' will be added later?so I didn't list all the possilble value in the docstring
Thanks @eightyseven
Bugfix : Added `mathjax_ignore` to HTMLFormatter._write_table and changed tests to assert `mathjax_ignore`
State: closed

- [x] closes #59884 
- [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.

Feedback would be appreciated.

Labels:

Comments:
/preview
@datapythonista - the `/preview` feature seems broken, I get a 500 response from the server.

https://github.com/pandas-dev/pandas/actions/runs/11469095078/job/31915606006

Should I open an issue?
This PR seems to have gone stale, can I take over this issue? Thanks

@rhshadrach @attack68 
@KevsterAmp - sounds good.
@rhshadrach - Do I commit on this branch or I re-open a new PR? Thanks
Thanks for this PR, but the issue was closed by https://github.com/pandas-dev/pandas/pull/60311
DOC: fix docstring for DataFrame.round()
State: closed

- [ ] closes #60009
- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-


Labels:
name: Docs

Comments:
Since I'm a beginner, I just simply fixed the docstring. If my work is correct, I'll continue fixing the 'See Also' and 'Examples' sections of DataFrame.round() and Series.round()
Thanks @eightyseven
DOC: fix RT03,SA01,ES01 for pandas.core.resample.Resampler.__iter__
State: closed

fixes

```
pandas.core.resample.Resampler.__iter__ RT03,SA01,ES01
pandas.core.groupby.DataFrameGroupBy.__iter__ RT03,SA01
pandas.core.groupby.SeriesGroupBy.__iter__ RT03,SA01
```

Labels:
name: Docs
name: Groupby
name: Resample
description: resample method

Comments:
Thanks @tuhinsharma121!
Add information about code coverage to docs
State: closed

Hello! This change adds code coverage documentation and also includes a link to the Codecov dashboard for Pandas within the contributing docs. Some of this information is otherwise implicit and I thought could be helpful for developers to understand or have an easy link handy.

Thank you for any thoughts or feedback you may have! And cheers on the great work with Pandas more broadly.

- [x] closes #60010 
- [ ] [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.
- [ ] 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

Comments:
Thanks @d33bs 
Thanks as well @mroeschke !
Update getting_started.css
State: closed

The problem is "DOC: Intro to pandas table not readily visible in dark mode #60024"
Perhaps we could set this part of the font color to blue, which is highly visible in either bright or dark mode, so that there is no need to implement a font color that changes with the theme.
So I made a very simple change in the documentation by setting the font color in .tutorial-card-header-2 to blue so that the font can be seen in either bright or dark mode.

Labels:

Comments:
> It seems preferable to me to agree with other versions of this page. Both `dev` and `2.1` display correctly, it's just 2.2 that does not. Why is this? Could it be a regression in the pydata-sphinx-theme that has since been fixed?

I noticed that both Dev and 2.2 are built with PyData-Sphinx-theme 0.14.4, so maybe something else is wrong. 
The issue raised on the PyData-Sphinx-theme's github didn't have anyone raise the same issue as the pandas 2.2 version, so maybe we can wait until the new version is released and see what happens.
DOC: Fix title capitalization in documentation files (#32550)
State: closed

Corrected title capitalization in various .rst files to match the standard of capitalizing only the first word

- doc\source\whatsnew\v0.12.0.rst
- doc\source\whatsnew\v0.25.0.rst
- doc\source\whatsnew\v1.2.0.rst
- doc\source\whatsnew\v3.0.0.rst

Fixes part of issue https://github.com/pandas-dev/pandas/issues/32550.











Labels:
name: Docs

Comments:
Fix title capitalization in documentation files
Thanks @Wong2333
DOC: Fix `GroupBy.ffill()` doc reference to rows
State: closed

## Description

The very last example in the GroupBy FFill documentation says "along rows", but (to be consistent with the convention established in the preceding examples) actually shows an example operating "along columns". Fix the reference.

## Checklist

- [X] closes #xxxx (Replace xxxx with the GitHub issue number) (No associated issue)
- [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 (Strictly documentation change)
- [ ] 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. (No new args/funcs)
- [X] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature. (No bugfix or new feature, just a minor documentation fix)


Labels:
name: Docs

Comments:
Thanks @sparshsah
Backport of string changes for 2.3 release - part 2
State: closed

Follow-up on https://github.com/pandas-dev/pandas/pull/59513, with a second set of backports

Labels:
name: Build
description: Library building on various platforms
name: Strings
description: String extension data type and string data

Comments:
Already green! 
(except for a time out of pre-commit.co, but I suppose that is unrelated)
Added Python 3.13 to pyproject.toml in classifiers
State: closed

- [ ] closes ##59978- added "'Programming Language :: Python :: 3.13'," to pyproject.toml 
- [ ] tests not needed for updating pyproject.toml in classifiers
- [ ] In the middle of installing code checks. If necessary will reinstall and resub my ticket if necessary
- [ ] New type annotations not necessary
- [ ] Not adding new feature


Labels:

Comments:
Thanks for the PR but as you mentioned in https://github.com/pandas-dev/pandas/issues/59978#issuecomment-2401058203 there's already an open PR for this issue so closing
Fix TypeError problem with the DataFrame.query() method when the DataFrame contains duplicate column names.
State: closed

This pull request includes a change to the `_get_cleaned_column_resolvers` method in the `pandas/core/generic.py` file. The change ensures that the correct data type is used when creating a `Series` object.

Data type handling improvement:

* [`pandas/core/generic.py`](diffhunk://#diff-1a2e3df0db7dd8bddc2ec4bff9de8a7a55e328e6c32e2cecde761dc9549fcd46L606-R608): Modified the `_get_cleaned_column_resolvers` method to use the correct data type (`dtype`) as iteration of `dtypes` when creating a `Series` object by including `dtypes` in the `zip` function.



Labels:

Comments:
Thanks for the PR, but we have a contributor already working on this issue (https://github.com/pandas-dev/pandas/pull/59971). If this PR goes stale we can reopen this one so closing
added markDown Feature
State: closed

- [ ] closes #60004 ? (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
    - I'm not sure if you have how you implement into the code base so I just gave use case examples  
- [ ] 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.

I am new to adding features and working with anything this extensive. I didn't realize to_markdown() was a function so I made my own. It also doesn't require tabulate and is around 40% fasters in my tests. Looking forward to any feedback. 


Labels:

Comments:
Thank you that makes total sense to me. Appreciate the feedback and prompt reply.