url
stringlengths 59
59
| repository_url
stringclasses 1
value | labels_url
stringlengths 73
73
| comments_url
stringlengths 68
68
| events_url
stringlengths 66
66
| html_url
stringlengths 47
49
| id
int64 2.5B
2.57B
| node_id
stringlengths 18
19
| number
int64 59.7k
60k
| title
stringlengths 12
140
| user
dict | labels
listlengths 0
6
| state
stringclasses 1
value | locked
bool 1
class | assignee
dict | assignees
listlengths 0
3
| milestone
dict | comments
int64 0
19
| created_at
timestamp[ms] | updated_at
timestamp[ms] | closed_at
null | author_association
stringclasses 3
values | active_lock_reason
null | draft
bool 2
classes | pull_request
dict | body
stringlengths 31
9.55k
| closed_by
dict | reactions
dict | timeline_url
stringlengths 68
68
| performed_via_github_app
null | state_reason
stringclasses 1
value |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
https://api.github.com/repos/pandas-dev/pandas/issues/60005 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/60005/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/60005/comments | https://api.github.com/repos/pandas-dev/pandas/issues/60005/events | https://github.com/pandas-dev/pandas/pull/60005 | 2,573,237,285 | PR_kwDOAA0YD8598-QS | 60,005 | Fix TypeError problem with the DataFrame.query() method when the DataFrame contains duplicate column names. | {
"login": "Asifussain",
"id": 93661420,
"node_id": "U_kgDOBZUo7A",
"avatar_url": "https://avatars.githubusercontent.com/u/93661420?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Asifussain",
"html_url": "https://github.com/Asifussain",
"followers_url": "https://api.github.com/users/Asifussain/followers",
"following_url": "https://api.github.com/users/Asifussain/following{/other_user}",
"gists_url": "https://api.github.com/users/Asifussain/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Asifussain/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Asifussain/subscriptions",
"organizations_url": "https://api.github.com/users/Asifussain/orgs",
"repos_url": "https://api.github.com/users/Asifussain/repos",
"events_url": "https://api.github.com/users/Asifussain/events{/privacy}",
"received_events_url": "https://api.github.com/users/Asifussain/received_events",
"type": "User",
"site_admin": false
} | [] | open | false | null | [] | null | 0 | 2024-10-08T13:37:35 | 2024-10-08T16:50:51 | null | NONE | null | false | {
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/60005",
"html_url": "https://github.com/pandas-dev/pandas/pull/60005",
"diff_url": "https://github.com/pandas-dev/pandas/pull/60005.diff",
"patch_url": "https://github.com/pandas-dev/pandas/pull/60005.patch",
"merged_at": null
} | 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.
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/60005/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/60005/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/60004 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/60004/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/60004/comments | https://api.github.com/repos/pandas-dev/pandas/issues/60004/events | https://github.com/pandas-dev/pandas/pull/60004 | 2,573,175,335 | PR_kwDOAA0YD8598wto | 60,004 | added markDown Feature | {
"login": "dmorton714",
"id": 102087408,
"node_id": "U_kgDOBhW68A",
"avatar_url": "https://avatars.githubusercontent.com/u/102087408?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/dmorton714",
"html_url": "https://github.com/dmorton714",
"followers_url": "https://api.github.com/users/dmorton714/followers",
"following_url": "https://api.github.com/users/dmorton714/following{/other_user}",
"gists_url": "https://api.github.com/users/dmorton714/gists{/gist_id}",
"starred_url": "https://api.github.com/users/dmorton714/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dmorton714/subscriptions",
"organizations_url": "https://api.github.com/users/dmorton714/orgs",
"repos_url": "https://api.github.com/users/dmorton714/repos",
"events_url": "https://api.github.com/users/dmorton714/events{/privacy}",
"received_events_url": "https://api.github.com/users/dmorton714/received_events",
"type": "User",
"site_admin": false
} | [] | open | false | null | [] | null | 0 | 2024-10-08T13:13:16 | 2024-10-08T13:13:16 | null | NONE | null | false | {
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/60004",
"html_url": "https://github.com/pandas-dev/pandas/pull/60004",
"diff_url": "https://github.com/pandas-dev/pandas/pull/60004.diff",
"patch_url": "https://github.com/pandas-dev/pandas/pull/60004.patch",
"merged_at": null
} | - [ ] 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.
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/60004/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/60004/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/60003 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/60003/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/60003/comments | https://api.github.com/repos/pandas-dev/pandas/issues/60003/events | https://github.com/pandas-dev/pandas/issues/60003 | 2,572,779,091 | I_kwDOAA0YD86ZWX5T | 60,003 | TYP: More precise NaT stubs | {
"login": "randolf-scholz",
"id": 39696536,
"node_id": "MDQ6VXNlcjM5Njk2NTM2",
"avatar_url": "https://avatars.githubusercontent.com/u/39696536?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/randolf-scholz",
"html_url": "https://github.com/randolf-scholz",
"followers_url": "https://api.github.com/users/randolf-scholz/followers",
"following_url": "https://api.github.com/users/randolf-scholz/following{/other_user}",
"gists_url": "https://api.github.com/users/randolf-scholz/gists{/gist_id}",
"starred_url": "https://api.github.com/users/randolf-scholz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/randolf-scholz/subscriptions",
"organizations_url": "https://api.github.com/users/randolf-scholz/orgs",
"repos_url": "https://api.github.com/users/randolf-scholz/repos",
"events_url": "https://api.github.com/users/randolf-scholz/events{/privacy}",
"received_events_url": "https://api.github.com/users/randolf-scholz/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 76812,
"node_id": "MDU6TGFiZWw3NjgxMg==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Enhancement",
"name": "Enhancement",
"color": "4E9A06",
"default": false,
"description": null
},
{
"id": 1954720290,
"node_id": "MDU6TGFiZWwxOTU0NzIwMjkw",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Needs%20Triage",
"name": "Needs Triage",
"color": "0052cc",
"default": false,
"description": "Issue that has not been reviewed by a pandas team member"
}
] | open | false | null | [] | null | 0 | 2024-10-08T10:30:01 | 2024-10-08T10:30:01 | null | CONTRIBUTOR | null | null | null | ### Feature Type
- [ ] Adding new functionality to pandas
- [X] Changing existing functionality in pandas
- [ ] Removing existing functionality in pandas
### Problem Description
Amendment to #59996. The current stub has some imprecise typing.
### Feature Description
- inequalities do not cover comparisons of NaTType with itself.
- addition/subtraction does not cover `pd.Period` and numpy types.
- dunder methods should be marked with positional-only parameters, even if the class supports keyword usage.
### Alternative Solutions
N/A
### Additional Context
_No response_ | null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/60003/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/60003/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/60002 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/60002/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/60002/comments | https://api.github.com/repos/pandas-dev/pandas/issues/60002/events | https://github.com/pandas-dev/pandas/pull/60002 | 2,572,484,029 | PR_kwDOAA0YD8596lP7 | 60,002 | Typing: More precise NaT stub | {
"login": "randolf-scholz",
"id": 39696536,
"node_id": "MDQ6VXNlcjM5Njk2NTM2",
"avatar_url": "https://avatars.githubusercontent.com/u/39696536?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/randolf-scholz",
"html_url": "https://github.com/randolf-scholz",
"followers_url": "https://api.github.com/users/randolf-scholz/followers",
"following_url": "https://api.github.com/users/randolf-scholz/following{/other_user}",
"gists_url": "https://api.github.com/users/randolf-scholz/gists{/gist_id}",
"starred_url": "https://api.github.com/users/randolf-scholz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/randolf-scholz/subscriptions",
"organizations_url": "https://api.github.com/users/randolf-scholz/orgs",
"repos_url": "https://api.github.com/users/randolf-scholz/repos",
"events_url": "https://api.github.com/users/randolf-scholz/events{/privacy}",
"received_events_url": "https://api.github.com/users/randolf-scholz/received_events",
"type": "User",
"site_admin": false
} | [] | open | false | null | [] | null | 0 | 2024-10-08T08:32:21 | 2024-10-08T10:30:25 | null | CONTRIBUTOR | null | false | {
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/60002",
"html_url": "https://github.com/pandas-dev/pandas/pull/60002",
"diff_url": "https://github.com/pandas-dev/pandas/pull/60002.diff",
"patch_url": "https://github.com/pandas-dev/pandas/pull/60002.patch",
"merged_at": null
} | - marked arguments in dunder methods positional only
(important for subclassing and protocols)
- added `Period`, `np.datetime64` and `np.timedelta64` as compatible for `__add__` and `__sub__`
- added `np.datetime64` and `np.timedelta64` as compatible with `__floordiv__` and `__truediv__`
- reworked comparisons:
- removed protocol and use plain definition
- changed return type from `bool` to `Literal[False]`
- added `Self` to comparable types, so that `pd.NaT > pd.NaT` is considered valid
- [x] closes #60003 (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
- [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.
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/60002/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/60002/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/60001 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/60001/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/60001/comments | https://api.github.com/repos/pandas-dev/pandas/issues/60001/events | https://github.com/pandas-dev/pandas/pull/60001 | 2,572,364,169 | PR_kwDOAA0YD8596NKe | 60,001 | Fix Styler docstring | {
"login": "albertvillanova",
"id": 8515462,
"node_id": "MDQ6VXNlcjg1MTU0NjI=",
"avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/albertvillanova",
"html_url": "https://github.com/albertvillanova",
"followers_url": "https://api.github.com/users/albertvillanova/followers",
"following_url": "https://api.github.com/users/albertvillanova/following{/other_user}",
"gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}",
"starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions",
"organizations_url": "https://api.github.com/users/albertvillanova/orgs",
"repos_url": "https://api.github.com/users/albertvillanova/repos",
"events_url": "https://api.github.com/users/albertvillanova/events{/privacy}",
"received_events_url": "https://api.github.com/users/albertvillanova/received_events",
"type": "User",
"site_admin": false
} | [] | open | false | null | [] | null | 0 | 2024-10-08T07:41:09 | 2024-10-08T08:31:21 | null | CONTRIBUTOR | null | false | {
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/60001",
"html_url": "https://github.com/pandas-dev/pandas/pull/60001",
"diff_url": "https://github.com/pandas-dev/pandas/pull/60001.diff",
"patch_url": "https://github.com/pandas-dev/pandas/pull/60001.patch",
"merged_at": null
} | - [ ] 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.
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/60001/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/60001/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59998 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59998/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59998/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59998/events | https://github.com/pandas-dev/pandas/pull/59998 | 2,570,929,321 | PR_kwDOAA0YD85914lo | 59,998 | [pre-commit.ci] pre-commit autoupdate | {
"login": "pre-commit-ci[bot]",
"id": 66853113,
"node_id": "MDM6Qm90NjY4NTMxMTM=",
"avatar_url": "https://avatars.githubusercontent.com/in/68672?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/pre-commit-ci%5Bbot%5D",
"html_url": "https://github.com/apps/pre-commit-ci",
"followers_url": "https://api.github.com/users/pre-commit-ci%5Bbot%5D/followers",
"following_url": "https://api.github.com/users/pre-commit-ci%5Bbot%5D/following{/other_user}",
"gists_url": "https://api.github.com/users/pre-commit-ci%5Bbot%5D/gists{/gist_id}",
"starred_url": "https://api.github.com/users/pre-commit-ci%5Bbot%5D/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/pre-commit-ci%5Bbot%5D/subscriptions",
"organizations_url": "https://api.github.com/users/pre-commit-ci%5Bbot%5D/orgs",
"repos_url": "https://api.github.com/users/pre-commit-ci%5Bbot%5D/repos",
"events_url": "https://api.github.com/users/pre-commit-ci%5Bbot%5D/events{/privacy}",
"received_events_url": "https://api.github.com/users/pre-commit-ci%5Bbot%5D/received_events",
"type": "Bot",
"site_admin": false
} | [
{
"id": 106935113,
"node_id": "MDU6TGFiZWwxMDY5MzUxMTM=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Code%20Style",
"name": "Code Style",
"color": "eb6420",
"default": false,
"description": "Code style, linting, code_checks"
}
] | open | false | null | [] | {
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/102",
"html_url": "https://github.com/pandas-dev/pandas/milestone/102",
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/102/labels",
"id": 9021906,
"node_id": "MI_kwDOAA0YD84AianS",
"number": 102,
"title": "3.0",
"description": "",
"creator": {
"login": "jbrockmendel",
"id": 8078968,
"node_id": "MDQ6VXNlcjgwNzg5Njg=",
"avatar_url": "https://avatars.githubusercontent.com/u/8078968?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/jbrockmendel",
"html_url": "https://github.com/jbrockmendel",
"followers_url": "https://api.github.com/users/jbrockmendel/followers",
"following_url": "https://api.github.com/users/jbrockmendel/following{/other_user}",
"gists_url": "https://api.github.com/users/jbrockmendel/gists{/gist_id}",
"starred_url": "https://api.github.com/users/jbrockmendel/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jbrockmendel/subscriptions",
"organizations_url": "https://api.github.com/users/jbrockmendel/orgs",
"repos_url": "https://api.github.com/users/jbrockmendel/repos",
"events_url": "https://api.github.com/users/jbrockmendel/events{/privacy}",
"received_events_url": "https://api.github.com/users/jbrockmendel/received_events",
"type": "User",
"site_admin": false
},
"open_issues": 42,
"closed_issues": 1325,
"state": "open",
"created_at": "2023-02-08T18:16:49",
"updated_at": "2024-10-08T02:35:04",
"due_on": null,
"closed_at": null
} | 3 | 2024-10-07T16:32:52 | 2024-10-07T22:46:28 | null | CONTRIBUTOR | null | false | {
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/59998",
"html_url": "https://github.com/pandas-dev/pandas/pull/59998",
"diff_url": "https://github.com/pandas-dev/pandas/pull/59998.diff",
"patch_url": "https://github.com/pandas-dev/pandas/pull/59998.patch",
"merged_at": null
} | <!--pre-commit.ci start-->
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.5.0 → v0.6.9](https://github.com/astral-sh/ruff-pre-commit/compare/v0.5.0...v0.6.9)
- [github.com/jendrikseipp/vulture: v2.11 → v2.13](https://github.com/jendrikseipp/vulture/compare/v2.11...v2.13)
- [github.com/pre-commit/pre-commit-hooks: v4.6.0 → v5.0.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.6.0...v5.0.0)
- [github.com/sphinx-contrib/sphinx-lint: v0.9.1 → v1.0.0](https://github.com/sphinx-contrib/sphinx-lint/compare/v0.9.1...v1.0.0)
- [github.com/pre-commit/mirrors-clang-format: v18.1.8 → v19.1.1](https://github.com/pre-commit/mirrors-clang-format/compare/v18.1.8...v19.1.1)
<!--pre-commit.ci end-->
Note: pyupgrade 3.17 needs to be coordinated with an upgrade in mypy & pyright | null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59998/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59998/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59997 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59997/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59997/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59997/events | https://github.com/pandas-dev/pandas/pull/59997 | 2,570,805,315 | PR_kwDOAA0YD8591fRr | 59,997 | BUG: fix #59965 skipna=True operations don't skip NaN in FloatingArrays | {
"login": "cooolheater",
"id": 184128544,
"node_id": "U_kgDOCvmUIA",
"avatar_url": "https://avatars.githubusercontent.com/u/184128544?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/cooolheater",
"html_url": "https://github.com/cooolheater",
"followers_url": "https://api.github.com/users/cooolheater/followers",
"following_url": "https://api.github.com/users/cooolheater/following{/other_user}",
"gists_url": "https://api.github.com/users/cooolheater/gists{/gist_id}",
"starred_url": "https://api.github.com/users/cooolheater/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/cooolheater/subscriptions",
"organizations_url": "https://api.github.com/users/cooolheater/orgs",
"repos_url": "https://api.github.com/users/cooolheater/repos",
"events_url": "https://api.github.com/users/cooolheater/events{/privacy}",
"received_events_url": "https://api.github.com/users/cooolheater/received_events",
"type": "User",
"site_admin": false
} | [] | open | false | null | [] | null | 0 | 2024-10-07T15:36:46 | 2024-10-07T23:54:09 | null | NONE | null | false | {
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/59997",
"html_url": "https://github.com/pandas-dev/pandas/pull/59997",
"diff_url": "https://github.com/pandas-dev/pandas/pull/59997.diff",
"patch_url": "https://github.com/pandas-dev/pandas/pull/59997.patch",
"merged_at": null
} | - Issue: The skipna was not properly handled for BaseMaskedArray
- Fix: Added mask for NA values
- Test: Added test to series/test_reductions since the test uses
- [X] closes #59965
- [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). | null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59997/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59997/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59994 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59994/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59994/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59994/events | https://github.com/pandas-dev/pandas/pull/59994 | 2,570,374,005 | PR_kwDOAA0YD8590FEn | 59,994 | enhancement on times.py | {
"login": "Lzforevr",
"id": 139556927,
"node_id": "U_kgDOCFF4Pw",
"avatar_url": "https://avatars.githubusercontent.com/u/139556927?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Lzforevr",
"html_url": "https://github.com/Lzforevr",
"followers_url": "https://api.github.com/users/Lzforevr/followers",
"following_url": "https://api.github.com/users/Lzforevr/following{/other_user}",
"gists_url": "https://api.github.com/users/Lzforevr/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Lzforevr/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lzforevr/subscriptions",
"organizations_url": "https://api.github.com/users/Lzforevr/orgs",
"repos_url": "https://api.github.com/users/Lzforevr/repos",
"events_url": "https://api.github.com/users/Lzforevr/events{/privacy}",
"received_events_url": "https://api.github.com/users/Lzforevr/received_events",
"type": "User",
"site_admin": false
} | [] | open | false | null | [] | null | 0 | 2024-10-07T12:59:45 | 2024-10-07T12:59:45 | null | NONE | null | true | {
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/59994",
"html_url": "https://github.com/pandas-dev/pandas/pull/59994",
"diff_url": "https://github.com/pandas-dev/pandas/pull/59994.diff",
"patch_url": "https://github.com/pandas-dev/pandas/pull/59994.patch",
"merged_at": null
} | - [ ] closes #59931 (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.
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59994/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59994/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59993 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59993/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59993/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59993/events | https://github.com/pandas-dev/pandas/pull/59993 | 2,570,365,077 | PR_kwDOAA0YD8590DHV | 59,993 | Enhancements in numeric.py for 0x,0o,0b | {
"login": "Lzforevr",
"id": 139556927,
"node_id": "U_kgDOCFF4Pw",
"avatar_url": "https://avatars.githubusercontent.com/u/139556927?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Lzforevr",
"html_url": "https://github.com/Lzforevr",
"followers_url": "https://api.github.com/users/Lzforevr/followers",
"following_url": "https://api.github.com/users/Lzforevr/following{/other_user}",
"gists_url": "https://api.github.com/users/Lzforevr/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Lzforevr/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lzforevr/subscriptions",
"organizations_url": "https://api.github.com/users/Lzforevr/orgs",
"repos_url": "https://api.github.com/users/Lzforevr/repos",
"events_url": "https://api.github.com/users/Lzforevr/events{/privacy}",
"received_events_url": "https://api.github.com/users/Lzforevr/received_events",
"type": "User",
"site_admin": false
} | [] | open | false | null | [] | null | 0 | 2024-10-07T12:56:10 | 2024-10-07T12:56:15 | null | NONE | null | true | {
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/59993",
"html_url": "https://github.com/pandas-dev/pandas/pull/59993",
"diff_url": "https://github.com/pandas-dev/pandas/pull/59993.diff",
"patch_url": "https://github.com/pandas-dev/pandas/pull/59993.patch",
"merged_at": null
} | - [x] closes #59207 (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.
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59993/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59993/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59987 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59987/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59987/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59987/events | https://github.com/pandas-dev/pandas/pull/59987 | 2,569,446,341 | PR_kwDOAA0YD859xDGj | 59,987 | Fix: Change None values to NaN in combine_first method for better han… | {
"login": "Lavishgangwani",
"id": 154001570,
"node_id": "U_kgDOCS3gog",
"avatar_url": "https://avatars.githubusercontent.com/u/154001570?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Lavishgangwani",
"html_url": "https://github.com/Lavishgangwani",
"followers_url": "https://api.github.com/users/Lavishgangwani/followers",
"following_url": "https://api.github.com/users/Lavishgangwani/following{/other_user}",
"gists_url": "https://api.github.com/users/Lavishgangwani/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Lavishgangwani/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lavishgangwani/subscriptions",
"organizations_url": "https://api.github.com/users/Lavishgangwani/orgs",
"repos_url": "https://api.github.com/users/Lavishgangwani/repos",
"events_url": "https://api.github.com/users/Lavishgangwani/events{/privacy}",
"received_events_url": "https://api.github.com/users/Lavishgangwani/received_events",
"type": "User",
"site_admin": false
} | [] | open | false | null | [] | null | 0 | 2024-10-07T06:24:16 | 2024-10-08T03:41:58 | null | NONE | null | false | {
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/59987",
"html_url": "https://github.com/pandas-dev/pandas/pull/59987",
"diff_url": "https://github.com/pandas-dev/pandas/pull/59987.diff",
"patch_url": "https://github.com/pandas-dev/pandas/pull/59987.patch",
"merged_at": null
} | ### Description
This pull request addresses issue #58977 by improving the handling of missing data in the `combine_first` method. The changes ensure that `None` values are replaced with `NaN`, which allows for better integration with other Pandas functions that expect `NaN` values.
### Related Issue
- Fixes #58977
### Checklist
- [x] Tests added and passed if fixing a bug or adding a new feature
- [x] All code checks passed
- [ ] Added type annotations to new arguments/methods/functions (if applicable)
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature | {
"login": "Lavishgangwani",
"id": 154001570,
"node_id": "U_kgDOCS3gog",
"avatar_url": "https://avatars.githubusercontent.com/u/154001570?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Lavishgangwani",
"html_url": "https://github.com/Lavishgangwani",
"followers_url": "https://api.github.com/users/Lavishgangwani/followers",
"following_url": "https://api.github.com/users/Lavishgangwani/following{/other_user}",
"gists_url": "https://api.github.com/users/Lavishgangwani/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Lavishgangwani/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lavishgangwani/subscriptions",
"organizations_url": "https://api.github.com/users/Lavishgangwani/orgs",
"repos_url": "https://api.github.com/users/Lavishgangwani/repos",
"events_url": "https://api.github.com/users/Lavishgangwani/events{/privacy}",
"received_events_url": "https://api.github.com/users/Lavishgangwani/received_events",
"type": "User",
"site_admin": false
} | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59987/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59987/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59985 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59985/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59985/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59985/events | https://github.com/pandas-dev/pandas/pull/59985 | 2,568,852,430 | PR_kwDOAA0YD859vRrP | 59,985 | Programming Language :: Python :: 3.13 added to pyproject.toml | {
"login": "nahcol10",
"id": 104910006,
"node_id": "U_kgDOBkDMtg",
"avatar_url": "https://avatars.githubusercontent.com/u/104910006?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/nahcol10",
"html_url": "https://github.com/nahcol10",
"followers_url": "https://api.github.com/users/nahcol10/followers",
"following_url": "https://api.github.com/users/nahcol10/following{/other_user}",
"gists_url": "https://api.github.com/users/nahcol10/gists{/gist_id}",
"starred_url": "https://api.github.com/users/nahcol10/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nahcol10/subscriptions",
"organizations_url": "https://api.github.com/users/nahcol10/orgs",
"repos_url": "https://api.github.com/users/nahcol10/repos",
"events_url": "https://api.github.com/users/nahcol10/events{/privacy}",
"received_events_url": "https://api.github.com/users/nahcol10/received_events",
"type": "User",
"site_admin": false
} | [] | open | false | null | [] | null | 0 | 2024-10-06T19:38:03 | 2024-10-06T19:41:47 | null | NONE | null | false | {
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/59985",
"html_url": "https://github.com/pandas-dev/pandas/pull/59985",
"diff_url": "https://github.com/pandas-dev/pandas/pull/59985.diff",
"patch_url": "https://github.com/pandas-dev/pandas/pull/59985.patch",
"merged_at": null
} | - [ ] 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.
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59985/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59985/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59978 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59978/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59978/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59978/events | https://github.com/pandas-dev/pandas/issues/59978 | 2,568,377,394 | I_kwDOAA0YD86ZFlQy | 59,978 | DOC: Pandas 2.2.3 pyproject.toml missing "Python 3.13" in classifiers -- but Pandas supports this Python version | {
"login": "surfaceowl",
"id": 22673372,
"node_id": "MDQ6VXNlcjIyNjczMzcy",
"avatar_url": "https://avatars.githubusercontent.com/u/22673372?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/surfaceowl",
"html_url": "https://github.com/surfaceowl",
"followers_url": "https://api.github.com/users/surfaceowl/followers",
"following_url": "https://api.github.com/users/surfaceowl/following{/other_user}",
"gists_url": "https://api.github.com/users/surfaceowl/gists{/gist_id}",
"starred_url": "https://api.github.com/users/surfaceowl/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/surfaceowl/subscriptions",
"organizations_url": "https://api.github.com/users/surfaceowl/orgs",
"repos_url": "https://api.github.com/users/surfaceowl/repos",
"events_url": "https://api.github.com/users/surfaceowl/events{/privacy}",
"received_events_url": "https://api.github.com/users/surfaceowl/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 134699,
"node_id": "MDU6TGFiZWwxMzQ2OTk=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Docs",
"name": "Docs",
"color": "3465A4",
"default": false,
"description": null
}
] | open | false | null | [] | null | 4 | 2024-10-06T00:11:40 | 2024-10-07T21:16:54 | null | NONE | null | null | null | ### Pandas version checks
- [X] I have checked that the issue still exists on the latest versions of the docs on `main` [here](https://pandas.pydata.org/docs/dev/)
### Location of the documentation
This does not directly impact Pandas behavior, so Docs is the best fit for issue from what I can see. On searching docs, this is the closest ref: [https://pandas.pydata.org/docs/dev/getting_started/install.html](https://pandas.pydata.org/docs/dev/getting_started/install.html)<br>
I also searched:
https://pandas.pydata.org/docs/dev/search.html?q=3.13
### Documentation problem
Pandas 2.2.3 `pyproject.toml` file does not include `Python 3.13` in the list of classifiers.<br>
Although Pandas 2.2.3 is broadly compatible with `Python 3.13`, that fact is not documented in `pyproject.toml` causing Pandas version support to be shown incorrectly on on PyPi and other python sources.<br>
The Pandas release announcement on 20 Sept 2024 [https://pandas.pydata.org/docs/whatsnew/v2.2.3.html](https://pandas.pydata.org/docs/whatsnew/v2.2.3.html) states: *"Pandas 2.2.3 is the first version of pandas that is generally compatible with the upcoming Python 3.13, and both wheels for free-threaded and normal `Python 3.13` will be uploaded for this release."* In addition, I have tested Pandas 2.2.3 with `Python 3.13.0rc3` and not found issues.
No documentation on current active docs reference Python 3.13: https://pandas.pydata.org/docs/dev/search.html?q=3.13<br>
*Impact -- People do not know Pandas is compatible with Python 3.13**
- on PyPi -- Pandas 2.2.3 does not show Python 3.13 Programming Language Classifier.
- on pyreadiness.org for Python 3.13 - Pandas does not show up as compatible with 3.13 [https://pyreadiness.org/3.13/](https://pyreadiness.org/3.13/)
### Suggested fix for documentation
**Suggested fix:**
- in [pandas main branch](https://github.com/pandas-dev/pandas/tree/main)<br>
- Add the following line to `pandas/pyproject.toml` in the `classifiers` block: <br> ```'Programming Language :: Python :: 3.13',```<br>
**Why it's better:**
Adding this change would populate the Programming Language section of the Classifiers on PyPi, which would then flow through to other sites like pyreadiness.org. | null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59978/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59978/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59977 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59977/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59977/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59977/events | https://github.com/pandas-dev/pandas/issues/59977 | 2,568,282,267 | I_kwDOAA0YD86ZFOCb | 59,977 | ENH: Add support for generating 4-4-5 but by month not just quarter or year | {
"login": "KuriaMaingi",
"id": 61688232,
"node_id": "MDQ6VXNlcjYxNjg4MjMy",
"avatar_url": "https://avatars.githubusercontent.com/u/61688232?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/KuriaMaingi",
"html_url": "https://github.com/KuriaMaingi",
"followers_url": "https://api.github.com/users/KuriaMaingi/followers",
"following_url": "https://api.github.com/users/KuriaMaingi/following{/other_user}",
"gists_url": "https://api.github.com/users/KuriaMaingi/gists{/gist_id}",
"starred_url": "https://api.github.com/users/KuriaMaingi/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/KuriaMaingi/subscriptions",
"organizations_url": "https://api.github.com/users/KuriaMaingi/orgs",
"repos_url": "https://api.github.com/users/KuriaMaingi/repos",
"events_url": "https://api.github.com/users/KuriaMaingi/events{/privacy}",
"received_events_url": "https://api.github.com/users/KuriaMaingi/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 76812,
"node_id": "MDU6TGFiZWw3NjgxMg==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Enhancement",
"name": "Enhancement",
"color": "4E9A06",
"default": false,
"description": null
},
{
"id": 1954720290,
"node_id": "MDU6TGFiZWwxOTU0NzIwMjkw",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Needs%20Triage",
"name": "Needs Triage",
"color": "0052cc",
"default": false,
"description": "Issue that has not been reviewed by a pandas team member"
}
] | open | false | null | [] | null | 0 | 2024-10-05T19:23:03 | 2024-10-05T19:23:03 | null | NONE | null | null | null | ### Feature Type
- [X] Adding new functionality to pandas
- [ ] Changing existing functionality in pandas
- [ ] Removing existing functionality in pandas
### Problem Description
Currently, you can generate quarters that fit the 4-4-5 fiscal calendar as is common in the retail world. [https://pandas.pydata.org/docs/reference/api/pandas.tseries.offsets.FY5253Quarter.html](url)
How can I generate a datetime index by month (generating a "future" dataframe for forecasting purposes) that matches the input data which is monthly & follows that 4-4-5 calendar?
For example, input data covers these time periods:
`['2020-07-05 00:00:00', '2020-08-02 00:00:00', '2020-08-30 00:00:00',
'2020-10-04 00:00:00', '2020-11-01 00:00:00', '2020-11-29 00:00:00',
'2021-01-03 00:00:00', '2021-01-31 00:00:00', '2021-02-28 00:00:00',
'2021-04-04 00:00:00', '2021-05-02 00:00:00', '2021-05-30 00:00:00',
'2021-07-04 00:00:00', '2021-08-01 00:00:00', '2021-08-29 00:00:00',
'2021-10-03 00:00:00', '2021-10-31 00:00:00', '2021-11-28 00:00:00',
'2022-01-02 00:00:00', '2022-01-30 00:00:00', '2022-02-27 00:00:00',
'2022-04-03 00:00:00', '2022-05-01 00:00:00', '2022-05-29 00:00:00',
'2022-07-03 00:00:00', '2022-07-31 00:00:00', '2022-08-28 00:00:00',
'2022-10-02 00:00:00', '2022-10-30 00:00:00', '2022-11-27 00:00:00',
'2023-01-01 00:00:00']`
I can generate the quarters that match up with this frequency by using the following code:
`yoffset = pd.offsets.FY5253Quarter(weekday=6, startingMonth=8, variation="last")
yindex = pd.date_range('2020-08-30', periods=12, freq=yoffset)
yindex`
which in turn generates the correct output:
`DatetimeIndex(['2020-08-30', '2020-11-29', '2021-02-28', '2021-05-30',
'2021-08-29', '2021-11-28', '2022-02-27', '2022-05-29',
'2022-08-28', '2022-11-27', '2023-02-26', '2023-05-28'],
dtype='datetime64[ns]', freq='REQ-L-AUG-SUN-1')`
How can I resample these quarterly periods to generate an equivalent 4-4-5 monthly frequency that follows the same ruleset?
### Feature Description
pd.offsets.FY5253Month(weekday=x, startingMonth=y, variation="z)
### Alternative Solutions
Not aware of any and currently stuck
### Additional Context
_No response_ | null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59977/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59977/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59976 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59976/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59976/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59976/events | https://github.com/pandas-dev/pandas/issues/59976 | 2,568,026,073 | I_kwDOAA0YD86ZEPfZ | 59,976 | DOC: Improve docs in the dt namespace | {
"login": "rhshadrach",
"id": 45562402,
"node_id": "MDQ6VXNlcjQ1NTYyNDAy",
"avatar_url": "https://avatars.githubusercontent.com/u/45562402?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/rhshadrach",
"html_url": "https://github.com/rhshadrach",
"followers_url": "https://api.github.com/users/rhshadrach/followers",
"following_url": "https://api.github.com/users/rhshadrach/following{/other_user}",
"gists_url": "https://api.github.com/users/rhshadrach/gists{/gist_id}",
"starred_url": "https://api.github.com/users/rhshadrach/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/rhshadrach/subscriptions",
"organizations_url": "https://api.github.com/users/rhshadrach/orgs",
"repos_url": "https://api.github.com/users/rhshadrach/repos",
"events_url": "https://api.github.com/users/rhshadrach/events{/privacy}",
"received_events_url": "https://api.github.com/users/rhshadrach/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 134699,
"node_id": "MDU6TGFiZWwxMzQ2OTk=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Docs",
"name": "Docs",
"color": "3465A4",
"default": false,
"description": null
},
{
"id": 219960758,
"node_id": "MDU6TGFiZWwyMTk5NjA3NTg=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Needs%20Discussion",
"name": "Needs Discussion",
"color": "207de5",
"default": false,
"description": "Requires discussion from core team before further action"
}
] | open | false | null | [] | null | 1 | 2024-10-05T13:08:12 | 2024-10-07T19:51:45 | null | MEMBER | null | null | null | Ref: https://github.com/pandas-dev/pandas/pull/59878#discussion_r1788584918
E.g. https://pandas.pydata.org/docs/dev/reference/api/pandas.Series.dt.to_period.html
We currently copy the docstring from the underlying array method, which is at times either vague or incorrect as in the example above. We could instead override the docstring with custom value in `pandas/core/accessor.py` in the `_create_delegator_method` function. We would need a place to store the docstrings, and it would be a significant effort to add them all.
Possible approach: Create a new subdirectory, `pandas/core/docstrings/` for storing docstrings for purposes like this, and add `series_dt.py` there. It would contain a dictionary mapping the method name to the docstring. | null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59976/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59976/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59973 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59973/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59973/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59973/events | https://github.com/pandas-dev/pandas/pull/59973 | 2,567,581,009 | PR_kwDOAA0YD859rYky | 59,973 | Shiny new feature | {
"login": "wshaoul",
"id": 82252983,
"node_id": "MDQ6VXNlcjgyMjUyOTgz",
"avatar_url": "https://avatars.githubusercontent.com/u/82252983?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/wshaoul",
"html_url": "https://github.com/wshaoul",
"followers_url": "https://api.github.com/users/wshaoul/followers",
"following_url": "https://api.github.com/users/wshaoul/following{/other_user}",
"gists_url": "https://api.github.com/users/wshaoul/gists{/gist_id}",
"starred_url": "https://api.github.com/users/wshaoul/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/wshaoul/subscriptions",
"organizations_url": "https://api.github.com/users/wshaoul/orgs",
"repos_url": "https://api.github.com/users/wshaoul/repos",
"events_url": "https://api.github.com/users/wshaoul/events{/privacy}",
"received_events_url": "https://api.github.com/users/wshaoul/received_events",
"type": "User",
"site_admin": false
} | [] | open | false | null | [] | null | 0 | 2024-10-05T01:17:44 | 2024-10-05T01:17:44 | null | NONE | null | false | {
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/59973",
"html_url": "https://github.com/pandas-dev/pandas/pull/59973",
"diff_url": "https://github.com/pandas-dev/pandas/pull/59973.diff",
"patch_url": "https://github.com/pandas-dev/pandas/pull/59973.patch",
"merged_at": null
} | - [ ] 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.
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59973/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59973/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59972 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59972/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59972/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59972/events | https://github.com/pandas-dev/pandas/pull/59972 | 2,567,554,253 | PR_kwDOAA0YD859rTGm | 59,972 | DOC: Fix title capitalization in documentation files (#32550) | {
"login": "steeleelliott03",
"id": 100764769,
"node_id": "U_kgDOBgGMYQ",
"avatar_url": "https://avatars.githubusercontent.com/u/100764769?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/steeleelliott03",
"html_url": "https://github.com/steeleelliott03",
"followers_url": "https://api.github.com/users/steeleelliott03/followers",
"following_url": "https://api.github.com/users/steeleelliott03/following{/other_user}",
"gists_url": "https://api.github.com/users/steeleelliott03/gists{/gist_id}",
"starred_url": "https://api.github.com/users/steeleelliott03/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/steeleelliott03/subscriptions",
"organizations_url": "https://api.github.com/users/steeleelliott03/orgs",
"repos_url": "https://api.github.com/users/steeleelliott03/repos",
"events_url": "https://api.github.com/users/steeleelliott03/events{/privacy}",
"received_events_url": "https://api.github.com/users/steeleelliott03/received_events",
"type": "User",
"site_admin": false
} | [] | open | false | null | [] | null | 0 | 2024-10-05T00:18:26 | 2024-10-05T00:18:26 | null | NONE | null | false | {
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/59972",
"html_url": "https://github.com/pandas-dev/pandas/pull/59972",
"diff_url": "https://github.com/pandas-dev/pandas/pull/59972.diff",
"patch_url": "https://github.com/pandas-dev/pandas/pull/59972.patch",
"merged_at": null
} | Corrected title capitalization in various .rst files to match the standard of capitalizing only the first word, unless a term like DataFrame or Series is involved.
Ran the script to find and
correct heading issues in the following files:
- doc/source/user_guide/timedeltas.rst
- doc/source/whatsnew/v0.7.0.rst
- doc/source/whatsnew/v0.23.4.rst
- (… and so on)
Fixes part of issue #32550.
- [ ] closes #32550
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59972/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59972/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59971 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59971/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59971/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59971/events | https://github.com/pandas-dev/pandas/pull/59971 | 2,567,203,196 | PR_kwDOAA0YD859qUuE | 59,971 | BUG: fix #59950 handle duplicate column names in dataframe queries | {
"login": "miguelcsx",
"id": 78029302,
"node_id": "MDQ6VXNlcjc4MDI5MzAy",
"avatar_url": "https://avatars.githubusercontent.com/u/78029302?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/miguelcsx",
"html_url": "https://github.com/miguelcsx",
"followers_url": "https://api.github.com/users/miguelcsx/followers",
"following_url": "https://api.github.com/users/miguelcsx/following{/other_user}",
"gists_url": "https://api.github.com/users/miguelcsx/gists{/gist_id}",
"starred_url": "https://api.github.com/users/miguelcsx/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/miguelcsx/subscriptions",
"organizations_url": "https://api.github.com/users/miguelcsx/orgs",
"repos_url": "https://api.github.com/users/miguelcsx/repos",
"events_url": "https://api.github.com/users/miguelcsx/events{/privacy}",
"received_events_url": "https://api.github.com/users/miguelcsx/received_events",
"type": "User",
"site_admin": false
} | [] | open | false | null | [] | null | 0 | 2024-10-04T19:42:45 | 2024-10-08T13:22:45 | null | NONE | null | false | {
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/59971",
"html_url": "https://github.com/pandas-dev/pandas/pull/59971",
"diff_url": "https://github.com/pandas-dev/pandas/pull/59971.diff",
"patch_url": "https://github.com/pandas-dev/pandas/pull/59971.patch",
"merged_at": null
} | ### Issue Description
When calling `DataFrame.query()` on a DataFrame with duplicate column names, an unexpected `TypeError` is raised due to a change introduced in pandas 2.2.1. The root cause is the `self.dtypes[k]` returning a Series for duplicate column names instead of a single value, leading to a failure in the query evaluation.
### Changes Made
- Fixed an issue where `Dataframe.query()` would throw an unexpected error
- The error was caused by `self.dtypes[k]`
- Adjusted the behavior to match the behavior prior to pandas version
- Added tests to ensure that `Dataframe.query()` works as expected
## PR Checklist
- [x] closes #59950
- [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.
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59971/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59971/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59965 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59965/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59965/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59965/events | https://github.com/pandas-dev/pandas/issues/59965 | 2,566,138,436 | I_kwDOAA0YD86Y9CpE | 59,965 | BUG: skipna=True operations don't skip NaN in FloatingArrays | {
"login": "carlocastoldi",
"id": 34198340,
"node_id": "MDQ6VXNlcjM0MTk4MzQw",
"avatar_url": "https://avatars.githubusercontent.com/u/34198340?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/carlocastoldi",
"html_url": "https://github.com/carlocastoldi",
"followers_url": "https://api.github.com/users/carlocastoldi/followers",
"following_url": "https://api.github.com/users/carlocastoldi/following{/other_user}",
"gists_url": "https://api.github.com/users/carlocastoldi/gists{/gist_id}",
"starred_url": "https://api.github.com/users/carlocastoldi/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/carlocastoldi/subscriptions",
"organizations_url": "https://api.github.com/users/carlocastoldi/orgs",
"repos_url": "https://api.github.com/users/carlocastoldi/repos",
"events_url": "https://api.github.com/users/carlocastoldi/events{/privacy}",
"received_events_url": "https://api.github.com/users/carlocastoldi/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 76811,
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug",
"name": "Bug",
"color": "e10c02",
"default": false,
"description": null
},
{
"id": 2822342,
"node_id": "MDU6TGFiZWwyODIyMzQy",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Missing-data",
"name": "Missing-data",
"color": "d7e102",
"default": false,
"description": "np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate"
},
{
"id": 849023693,
"node_id": "MDU6TGFiZWw4NDkwMjM2OTM=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/ExtensionArray",
"name": "ExtensionArray",
"color": "6138b5",
"default": false,
"description": "Extending pandas with custom dtypes or arrays."
},
{
"id": 2365504383,
"node_id": "MDU6TGFiZWwyMzY1NTA0Mzgz",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Reduction%20Operations",
"name": "Reduction Operations",
"color": "547c03",
"default": false,
"description": "sum, mean, min, max, etc."
},
{
"id": 6129961102,
"node_id": "LA_kwDOAA0YD88AAAABbV_Ijg",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/PDEP%20missing%20values",
"name": "PDEP missing values",
"color": "fbca04",
"default": false,
"description": "Issues that would be addressed by the Ice Cream Agreement from the Aug 2023 sprint"
}
] | open | false | null | [] | null | 1 | 2024-10-04T11:24:31 | 2024-10-07T15:37:39 | null | NONE | null | null | null | ### Pandas version checks
- [X] I have checked that this issue has not already been reported.
- [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas.
- [X] I have confirmed this bug exists on the [main branch](https://pandas.pydata.org/docs/dev/getting_started/install.html#installing-the-development-version-of-pandas) of pandas.
### Reproducible Example
```python
import pandas as pd
s1 = pd.Series({"a": 0.0, "b": 1, "c": 1, "d": 0})
s2 = pd.Series({"a": 0.0, "b": 2, "c": 2, "d": 2})
s3 = s1/s2
#display(s3)
s4 = s1.convert_dtypes()/s2.convert_dtypes()
#display(s4)
s5 = pd.Series([None,0.5,0.5,0]).convert_dtypes()
#display(s5)
s3.mean(skipna=True), s4.mean(skipna=True), s5.mean(skipna=True)
```
### Issue Description
Following #59961, I understand that series/dataframes of FloatingArrays cointaing `np.NaN` values are possible and meant to exists. These very same dataframes/series, however, fail to skip `NaN` values when asked to. The above examples outputs:
```
(np.float64(0.3333333333333333), <NA>, np.float64(0.3333333333333333))
```
### Expected Behavior
```
>>> s4.mean(skipna=True)
np.float64(0.3333333333333333)
```
### Installed Versions
<details>
INSTALLED VERSIONS
------------------
commit : 139def2145b83d40364235c6297e1833eab7bb05
python : 3.12.3
python-bits : 64
OS : Linux
OS-release : 6.8.0-41-generic
Version : #41-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 2 20:41:06 UTC 2024
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_GB.UTF-8
LOCALE : en_GB.UTF-8
pandas : 3.0.0.dev0+1545.g139def2145
numpy : 2.2.0.dev0+git20240930.3ee9e6a
dateutil : 2.9.0.post0
pip : 24.0
Cython : None
sphinx : None
IPython : None
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : None
blosc : None
bottleneck : None
fastparquet : None
fsspec : None
html5lib : None
hypothesis : None
gcsfs : None
jinja2 : None
lxml.etree : None
matplotlib : None
numba : None
numexpr : None
odfpy : None
openpyxl : None
psycopg2 : None
pymysql : None
pyarrow : None
pyreadstat : None
pytest : None
python-calamine : None
pytz : None
pyxlsb : None
s3fs : None
scipy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlsxwriter : None
zstandard : None
tzdata : 2024.2
qtpy : None
pyqt5 : None
</details>
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59965/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59965/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59963 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59963/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59963/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59963/events | https://github.com/pandas-dev/pandas/pull/59963 | 2,565,996,942 | PR_kwDOAA0YD859mho8 | 59,963 | Fix API: astype method fails to raise errors for category data type | {
"login": "HagonChan",
"id": 77165006,
"node_id": "MDQ6VXNlcjc3MTY1MDA2",
"avatar_url": "https://avatars.githubusercontent.com/u/77165006?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/HagonChan",
"html_url": "https://github.com/HagonChan",
"followers_url": "https://api.github.com/users/HagonChan/followers",
"following_url": "https://api.github.com/users/HagonChan/following{/other_user}",
"gists_url": "https://api.github.com/users/HagonChan/gists{/gist_id}",
"starred_url": "https://api.github.com/users/HagonChan/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/HagonChan/subscriptions",
"organizations_url": "https://api.github.com/users/HagonChan/orgs",
"repos_url": "https://api.github.com/users/HagonChan/repos",
"events_url": "https://api.github.com/users/HagonChan/events{/privacy}",
"received_events_url": "https://api.github.com/users/HagonChan/received_events",
"type": "User",
"site_admin": false
} | [] | open | false | null | [] | null | 0 | 2024-10-04T10:09:06 | 2024-10-04T10:23:15 | null | NONE | null | false | {
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/59963",
"html_url": "https://github.com/pandas-dev/pandas/pull/59963",
"diff_url": "https://github.com/pandas-dev/pandas/pull/59963.diff",
"patch_url": "https://github.com/pandas-dev/pandas/pull/59963.patch",
"merged_at": null
} | - [x] closes #59899 (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.
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59963/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59963/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59956 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59956/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59956/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59956/events | https://github.com/pandas-dev/pandas/issues/59956 | 2,565,553,657 | I_kwDOAA0YD86Y6z35 | 59,956 | ENH: Disable Numpy memory allocation while concat | {
"login": "sandeyshc",
"id": 45159475,
"node_id": "MDQ6VXNlcjQ1MTU5NDc1",
"avatar_url": "https://avatars.githubusercontent.com/u/45159475?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/sandeyshc",
"html_url": "https://github.com/sandeyshc",
"followers_url": "https://api.github.com/users/sandeyshc/followers",
"following_url": "https://api.github.com/users/sandeyshc/following{/other_user}",
"gists_url": "https://api.github.com/users/sandeyshc/gists{/gist_id}",
"starred_url": "https://api.github.com/users/sandeyshc/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sandeyshc/subscriptions",
"organizations_url": "https://api.github.com/users/sandeyshc/orgs",
"repos_url": "https://api.github.com/users/sandeyshc/repos",
"events_url": "https://api.github.com/users/sandeyshc/events{/privacy}",
"received_events_url": "https://api.github.com/users/sandeyshc/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 76812,
"node_id": "MDU6TGFiZWw3NjgxMg==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Enhancement",
"name": "Enhancement",
"color": "4E9A06",
"default": false,
"description": null
},
{
"id": 8935311,
"node_id": "MDU6TGFiZWw4OTM1MzEx",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Performance",
"name": "Performance",
"color": "a10c02",
"default": false,
"description": "Memory or execution speed performance"
},
{
"id": 307649777,
"node_id": "MDU6TGFiZWwzMDc2NDk3Nzc=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Needs%20Info",
"name": "Needs Info",
"color": "207de5",
"default": false,
"description": "Clarification about behavior needed to assess issue"
}
] | open | false | null | [] | null | 1 | 2024-10-04T06:25:07 | 2024-10-05T13:39:13 | null | NONE | null | null | null | ### Feature Type
- [ ] Adding new functionality to pandas
- [X] Changing existing functionality in pandas
- [ ] Removing existing functionality in pandas
### Problem Description
We have sparse data with many null values, and while reading it using Pandas with PyArrow, it doesn't consume much memory because of pandas internal compression logic. However, during concatenation, NumPy allocates memory that isn't actually used, causing our Python script to fail due to memory allocation issues. Can you provide an option to disable NumPy memory allocation when concatenating DataFrames along axis=1?
### Feature Description
pd.concat(df_list,axis=1,numpy_allocation=False)
### Alternative Solutions
Atleast can you provide how can we change C++ script internally and use it for our purpose
### Additional Context
Please let me know if i am wrong. | null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59956/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59956/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59955 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59955/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59955/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59955/events | https://github.com/pandas-dev/pandas/pull/59955 | 2,565,217,863 | PR_kwDOAA0YD859kBS- | 59,955 | DOCS: fix docstring validation errors for pandas.Series #59595 | {
"login": "d-urbonas",
"id": 110120780,
"node_id": "U_kgDOBpBPTA",
"avatar_url": "https://avatars.githubusercontent.com/u/110120780?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/d-urbonas",
"html_url": "https://github.com/d-urbonas",
"followers_url": "https://api.github.com/users/d-urbonas/followers",
"following_url": "https://api.github.com/users/d-urbonas/following{/other_user}",
"gists_url": "https://api.github.com/users/d-urbonas/gists{/gist_id}",
"starred_url": "https://api.github.com/users/d-urbonas/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/d-urbonas/subscriptions",
"organizations_url": "https://api.github.com/users/d-urbonas/orgs",
"repos_url": "https://api.github.com/users/d-urbonas/repos",
"events_url": "https://api.github.com/users/d-urbonas/events{/privacy}",
"received_events_url": "https://api.github.com/users/d-urbonas/received_events",
"type": "User",
"site_admin": false
} | [] | open | false | null | [] | null | 1 | 2024-10-04T00:53:30 | 2024-10-05T17:49:45 | null | NONE | null | false | {
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/59955",
"html_url": "https://github.com/pandas-dev/pandas/pull/59955",
"diff_url": "https://github.com/pandas-dev/pandas/pull/59955.diff",
"patch_url": "https://github.com/pandas-dev/pandas/pull/59955.patch",
"merged_at": null
} | Fixes the following issues from #59595
-i "pandas.Series.sparse.fill_value SA01" \
-i "pandas.Series.str.match RT03" \
- [x] Partially addresses #59595
- [ ] [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.
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59955/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59955/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59954 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59954/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59954/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59954/events | https://github.com/pandas-dev/pandas/pull/59954 | 2,565,140,689 | PR_kwDOAA0YD859jw7E | 59,954 | BUG: PeriodIndex.to_datetime inconsistent with its docstring | {
"login": "aram-cinnamon",
"id": 97805700,
"node_id": "U_kgDOBdRlhA",
"avatar_url": "https://avatars.githubusercontent.com/u/97805700?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/aram-cinnamon",
"html_url": "https://github.com/aram-cinnamon",
"followers_url": "https://api.github.com/users/aram-cinnamon/followers",
"following_url": "https://api.github.com/users/aram-cinnamon/following{/other_user}",
"gists_url": "https://api.github.com/users/aram-cinnamon/gists{/gist_id}",
"starred_url": "https://api.github.com/users/aram-cinnamon/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/aram-cinnamon/subscriptions",
"organizations_url": "https://api.github.com/users/aram-cinnamon/orgs",
"repos_url": "https://api.github.com/users/aram-cinnamon/repos",
"events_url": "https://api.github.com/users/aram-cinnamon/events{/privacy}",
"received_events_url": "https://api.github.com/users/aram-cinnamon/received_events",
"type": "User",
"site_admin": false
} | [] | open | false | null | [] | null | 0 | 2024-10-03T23:15:01 | 2024-10-06T09:44:28 | null | CONTRIBUTOR | null | false | {
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/59954",
"html_url": "https://github.com/pandas-dev/pandas/pull/59954",
"diff_url": "https://github.com/pandas-dev/pandas/pull/59954.diff",
"patch_url": "https://github.com/pandas-dev/pandas/pull/59954.patch",
"merged_at": null
} | - [x] closes #59371
- [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.
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59954/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59954/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59953 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59953/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59953/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59953/events | https://github.com/pandas-dev/pandas/issues/59953 | 2,564,147,199 | I_kwDOAA0YD86Y1cf_ | 59,953 | ENH: Is there a way to plot a long format data in matplotlib without pivoting the table ? | {
"login": "infinity-void6",
"id": 96457876,
"node_id": "U_kgDOBb_UlA",
"avatar_url": "https://avatars.githubusercontent.com/u/96457876?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/infinity-void6",
"html_url": "https://github.com/infinity-void6",
"followers_url": "https://api.github.com/users/infinity-void6/followers",
"following_url": "https://api.github.com/users/infinity-void6/following{/other_user}",
"gists_url": "https://api.github.com/users/infinity-void6/gists{/gist_id}",
"starred_url": "https://api.github.com/users/infinity-void6/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/infinity-void6/subscriptions",
"organizations_url": "https://api.github.com/users/infinity-void6/orgs",
"repos_url": "https://api.github.com/users/infinity-void6/repos",
"events_url": "https://api.github.com/users/infinity-void6/events{/privacy}",
"received_events_url": "https://api.github.com/users/infinity-void6/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 2413328,
"node_id": "MDU6TGFiZWwyNDEzMzI4",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Visualization",
"name": "Visualization",
"color": "8AE234",
"default": false,
"description": "plotting"
},
{
"id": 34444536,
"node_id": "MDU6TGFiZWwzNDQ0NDUzNg==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Usage%20Question",
"name": "Usage Question",
"color": "0052cc",
"default": false,
"description": null
},
{
"id": 307649777,
"node_id": "MDU6TGFiZWwzMDc2NDk3Nzc=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Needs%20Info",
"name": "Needs Info",
"color": "207de5",
"default": false,
"description": "Clarification about behavior needed to assess issue"
},
{
"id": 2365504893,
"node_id": "MDU6TGFiZWwyMzY1NTA0ODkz",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Closing%20Candidate",
"name": "Closing Candidate",
"color": "be21f2",
"default": false,
"description": "May be closeable, needs more eyeballs"
}
] | open | false | null | [] | null | 2 | 2024-10-03T13:59:42 | 2024-10-06T18:30:15 | null | NONE | null | null | null | ### Feature Type
- [ ] Adding new functionality to pandas
- [ ] Changing existing functionality in pandas
- [ ] Removing existing functionality in pandas
### Problem Description
### Problem
I am currently reading this book called Hands On Data Analysis using Pandas by Stefie Molin. There are two formats of data, wide and long format data. The author uses pandas and matplotlib to plot a wide format data while uses seaborn package for the long format data. I tried searching in the web and it seems to be the custom. I tried asking gpt as well, and I can plot the long format data without seaborn too but it seems that I have to pivot the dataset. Is there a way around it .
Wide Data Frame Sample
date | TMAX | TMIN | TOBS
-- | -- | -- | --
2018-10-28 | 8.3 | 5.0 | 7.2
2018-10-04 | 22.8 | 11.7 | 11.7
2018-10-20 | 15.0 | -0.6 | 10.6
2018-10-24 | 16.7 | 4.4 | 6.7
2018-10-23 | 15.6 | -1.1 | 10.0
Long Data Frame Sample
date | datatype | value
-- | -- | --
2018-10-01 | TMAX | 21.1
2018-10-01 | TMIN | 8.9
2018-10-01 | TOBS | 13.9
2018-10-02 | TMAX | 23.9
2018-10-02 | TMIN | 13.9
2018-10-02 | TOBS | 17.2
Long Data Frame after pivoting

plot command for wide df
`ax = wide_df.plot(
x='date',
y=['TMAX', 'TMIN', 'TOBS'],
figsize=(15, 5),
title='Temperature in NYC in October 2018'
)
`
plot command for long df after pivot
`ax=long_df.pivot(index='date',columns='datatype',values='value')`
and apply a similar command as above
plot command for long_df with seaborn
`ax=sns.lineplot(data=long_df,x='date',y='value',hue='datatype')`
Why isn't there a hue parameter or something similar in pandas for a long data format? My question can also be framed this way,
" Why is pandas not enough for plotting? Why do I need external packages like matplotlib and seaborn to plot pandas data structure?"
Forgive me for my ignorance but I really want to know why cann't the features available in pandas and seaborn be available in pandas.
### Feature Description
Lets start with a hue feature in pandas for a long data format
### Alternative Solutions
we might have to pivot the table if we have to plot without using seaborn if we just need to use pandas
### Additional Context
_No response_ | null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59953/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59953/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59950 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59950/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59950/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59950/events | https://github.com/pandas-dev/pandas/issues/59950 | 2,563,513,795 | I_kwDOAA0YD86YzB3D | 59,950 | BUG: DataFrame.query() throws error when df has duplicate column names | {
"login": "ddenuyl-bebr",
"id": 151915448,
"node_id": "U_kgDOCQ4LuA",
"avatar_url": "https://avatars.githubusercontent.com/u/151915448?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ddenuyl-bebr",
"html_url": "https://github.com/ddenuyl-bebr",
"followers_url": "https://api.github.com/users/ddenuyl-bebr/followers",
"following_url": "https://api.github.com/users/ddenuyl-bebr/following{/other_user}",
"gists_url": "https://api.github.com/users/ddenuyl-bebr/gists{/gist_id}",
"starred_url": "https://api.github.com/users/ddenuyl-bebr/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ddenuyl-bebr/subscriptions",
"organizations_url": "https://api.github.com/users/ddenuyl-bebr/orgs",
"repos_url": "https://api.github.com/users/ddenuyl-bebr/repos",
"events_url": "https://api.github.com/users/ddenuyl-bebr/events{/privacy}",
"received_events_url": "https://api.github.com/users/ddenuyl-bebr/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 76811,
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug",
"name": "Bug",
"color": "e10c02",
"default": false,
"description": null
},
{
"id": 717120670,
"node_id": "MDU6TGFiZWw3MTcxMjA2NzA=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/good%20first%20issue",
"name": "good first issue",
"color": "0e8a16",
"default": true,
"description": null
},
{
"id": 1631985267,
"node_id": "MDU6TGFiZWwxNjMxOTg1MjY3",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/expressions",
"name": "expressions",
"color": "f3afff",
"default": false,
"description": "pd.eval, query"
}
] | open | false | {
"login": "miguelcsx",
"id": 78029302,
"node_id": "MDQ6VXNlcjc4MDI5MzAy",
"avatar_url": "https://avatars.githubusercontent.com/u/78029302?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/miguelcsx",
"html_url": "https://github.com/miguelcsx",
"followers_url": "https://api.github.com/users/miguelcsx/followers",
"following_url": "https://api.github.com/users/miguelcsx/following{/other_user}",
"gists_url": "https://api.github.com/users/miguelcsx/gists{/gist_id}",
"starred_url": "https://api.github.com/users/miguelcsx/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/miguelcsx/subscriptions",
"organizations_url": "https://api.github.com/users/miguelcsx/orgs",
"repos_url": "https://api.github.com/users/miguelcsx/repos",
"events_url": "https://api.github.com/users/miguelcsx/events{/privacy}",
"received_events_url": "https://api.github.com/users/miguelcsx/received_events",
"type": "User",
"site_admin": false
} | [
{
"login": "miguelcsx",
"id": 78029302,
"node_id": "MDQ6VXNlcjc4MDI5MzAy",
"avatar_url": "https://avatars.githubusercontent.com/u/78029302?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/miguelcsx",
"html_url": "https://github.com/miguelcsx",
"followers_url": "https://api.github.com/users/miguelcsx/followers",
"following_url": "https://api.github.com/users/miguelcsx/following{/other_user}",
"gists_url": "https://api.github.com/users/miguelcsx/gists{/gist_id}",
"starred_url": "https://api.github.com/users/miguelcsx/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/miguelcsx/subscriptions",
"organizations_url": "https://api.github.com/users/miguelcsx/orgs",
"repos_url": "https://api.github.com/users/miguelcsx/repos",
"events_url": "https://api.github.com/users/miguelcsx/events{/privacy}",
"received_events_url": "https://api.github.com/users/miguelcsx/received_events",
"type": "User",
"site_admin": false
},
{
"login": "Asifussain",
"id": 93661420,
"node_id": "U_kgDOBZUo7A",
"avatar_url": "https://avatars.githubusercontent.com/u/93661420?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Asifussain",
"html_url": "https://github.com/Asifussain",
"followers_url": "https://api.github.com/users/Asifussain/followers",
"following_url": "https://api.github.com/users/Asifussain/following{/other_user}",
"gists_url": "https://api.github.com/users/Asifussain/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Asifussain/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Asifussain/subscriptions",
"organizations_url": "https://api.github.com/users/Asifussain/orgs",
"repos_url": "https://api.github.com/users/Asifussain/repos",
"events_url": "https://api.github.com/users/Asifussain/events{/privacy}",
"received_events_url": "https://api.github.com/users/Asifussain/received_events",
"type": "User",
"site_admin": false
}
] | null | 10 | 2024-10-03T09:07:39 | 2024-10-08T15:17:58 | null | NONE | null | null | null | ### Pandas version checks
- [X] I have checked that this issue has not already been reported.
- [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas.
- [X] I have confirmed this bug exists on the [main branch](https://pandas.pydata.org/docs/dev/getting_started/install.html#installing-the-development-version-of-pandas) of pandas.
### Reproducible Example
```python
import pandas as pd
df = pd.DataFrame({'a': range(3), 'b': range(3), 'c': range(3)}).rename(columns={'b': 'a'})
print(df.query('c == 1'))
```
### Issue Description
Since pandas 2.2.1 this throws an unexpected error:
`TypeError: dtype 'a int64
a int64
dtype: object' not understood`
This is because DataFrame.query() calls DataFrame.eval() which in turn calls DataFrame._get_cleaned_column_resolvers().
The dict comprehension in DataFrame._get_cleaned_column_resolvers() was changed in version 2.2.1.
version 2.2.0
```
return {
clean_column_name(k): Series(
v, copy=False, index=self.index, name=k
).__finalize__(self)
for k, v in zip(self.columns, self._iter_column_arrays())
if not isinstance(k, int)
}
```
version 2.2.1
```
return {
clean_column_name(k): Series(
v, copy=False, index=self.index, name=k, dtype=self.dtypes[k]
).__finalize__(self)
for k, v in zip(self.columns, self._iter_column_arrays())
if not isinstance(k, int)
}
```
since the dtypes are now checked when the Series are created, this introduces the error described above, since for a duplicate
column name self.dtypes[k] returns a Series instead of single value.
### Expected Behavior
1) I would expect either the behavior prior to v2.2.1 where the above example would return:
```
>>> df.query('c == 1')
a a c
1 1 1 1
```
moreover, calling query() on column 'a' also works:
```
>>> df.query('a == 1')
a a c
1 1 1 1
```
or
2) If above behavior is unwanted, I would except better error handling, smt like:
```
>>> df.query('c == 1')
DuplicateColumnError: DataFrame.query() is not supported for DataFrames with duplicate column names
```
### Installed Versions
INSTALLED VERSIONS
------------------
commit : bdc79c146c2e32f2cab629be240f01658cfb6cc2
python : 3.11.6.final.0
python-bits : 64
OS : Linux
OS-release : 5.4.0-165-generic
Version : #182-Ubuntu SMP Mon Oct 2 19:43:28 UTC 2023
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 2.2.1
numpy : 1.26.4
pytz : 2024.1
dateutil : 2.8.2
setuptools : 69.1.1
pip : 23.0
Cython : None
pytest : 8.2.0
hypothesis : 6.100.4
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : 5.2.2
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 3.1.3
IPython : None
pandas_datareader : None
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : None
bottleneck : None
dataframe-api-compat : None
fastparquet : None
fsspec : None
gcsfs : None
matplotlib : None
numba : None
numexpr : None
odfpy : None
openpyxl : 3.1.2
pandas_gbq : 0.19.2
pyarrow : 15.0.0
pyreadstat : None
python-calamine : None
pyxlsb : None
s3fs : None
scipy : None
sqlalchemy : 2.0.27
tables : None
tabulate : 0.9.0
xarray : None
xlrd : None
zstandard : None
tzdata : 2024.1
qtpy : None
pyqt5 : None | null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59950/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59950/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59948 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59948/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59948/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59948/events | https://github.com/pandas-dev/pandas/pull/59948 | 2,563,181,832 | PR_kwDOAA0YD859dHgl | 59,948 | Update html.py | {
"login": "JustinCapili",
"id": 107870885,
"node_id": "U_kgDOBm36pQ",
"avatar_url": "https://avatars.githubusercontent.com/u/107870885?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/JustinCapili",
"html_url": "https://github.com/JustinCapili",
"followers_url": "https://api.github.com/users/JustinCapili/followers",
"following_url": "https://api.github.com/users/JustinCapili/following{/other_user}",
"gists_url": "https://api.github.com/users/JustinCapili/gists{/gist_id}",
"starred_url": "https://api.github.com/users/JustinCapili/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/JustinCapili/subscriptions",
"organizations_url": "https://api.github.com/users/JustinCapili/orgs",
"repos_url": "https://api.github.com/users/JustinCapili/repos",
"events_url": "https://api.github.com/users/JustinCapili/events{/privacy}",
"received_events_url": "https://api.github.com/users/JustinCapili/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 76811,
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug",
"name": "Bug",
"color": "e10c02",
"default": false,
"description": null
},
{
"id": 13101118,
"node_id": "MDU6TGFiZWwxMzEwMTExOA==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Output-Formatting",
"name": "Output-Formatting",
"color": "ededed",
"default": false,
"description": "__repr__ of pandas objects, to_string"
}
] | open | false | null | [] | null | 0 | 2024-10-03T05:53:16 | 2024-10-05T13:15:29 | null | NONE | null | false | {
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/59948",
"html_url": "https://github.com/pandas-dev/pandas/pull/59948",
"diff_url": "https://github.com/pandas-dev/pandas/pull/59948.diff",
"patch_url": "https://github.com/pandas-dev/pandas/pull/59948.patch",
"merged_at": null
} | Adding a mathjax_ignore as a bug fix to ensure that proper formatting is performed
- [X] closes #59884 (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
- [ ] 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.
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59948/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59948/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59947 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59947/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59947/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59947/events | https://github.com/pandas-dev/pandas/pull/59947 | 2,562,806,464 | PR_kwDOAA0YD859b4oy | 59,947 | Update hist.py | {
"login": "rraadd88",
"id": 9945034,
"node_id": "MDQ6VXNlcjk5NDUwMzQ=",
"avatar_url": "https://avatars.githubusercontent.com/u/9945034?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/rraadd88",
"html_url": "https://github.com/rraadd88",
"followers_url": "https://api.github.com/users/rraadd88/followers",
"following_url": "https://api.github.com/users/rraadd88/following{/other_user}",
"gists_url": "https://api.github.com/users/rraadd88/gists{/gist_id}",
"starred_url": "https://api.github.com/users/rraadd88/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/rraadd88/subscriptions",
"organizations_url": "https://api.github.com/users/rraadd88/orgs",
"repos_url": "https://api.github.com/users/rraadd88/repos",
"events_url": "https://api.github.com/users/rraadd88/events{/privacy}",
"received_events_url": "https://api.github.com/users/rraadd88/received_events",
"type": "User",
"site_admin": false
} | [] | open | false | null | [] | null | 0 | 2024-10-02T23:17:22 | 2024-10-03T16:12:01 | null | NONE | null | false | {
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/59947",
"html_url": "https://github.com/pandas-dev/pandas/pull/59947",
"diff_url": "https://github.com/pandas-dev/pandas/pull/59947.diff",
"patch_url": "https://github.com/pandas-dev/pandas/pull/59947.patch",
"merged_at": null
} | Minor improvement, allowing inference of the xlabel for a histgram plotted using a Series.
Reduces these lines of code:
```
ax=ds.hist()
ax.set(
xlabel=ds.name,
)
```
to
```
ds.hist()
```
---
- [NA] closes #xxxx (Replace xxxx with the GitHub issue number)
- [NA] [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
- [NA] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [NA] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [NA] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59947/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59947/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59942 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59942/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59942/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59942/events | https://github.com/pandas-dev/pandas/pull/59942 | 2,561,946,080 | PR_kwDOAA0YD859Y9J0 | 59,942 | Enhanced numeric.py to process hexadecimal,decimal,binary formats(0x 0o 0b…) | {
"login": "Lzforevr",
"id": 139556927,
"node_id": "U_kgDOCFF4Pw",
"avatar_url": "https://avatars.githubusercontent.com/u/139556927?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Lzforevr",
"html_url": "https://github.com/Lzforevr",
"followers_url": "https://api.github.com/users/Lzforevr/followers",
"following_url": "https://api.github.com/users/Lzforevr/following{/other_user}",
"gists_url": "https://api.github.com/users/Lzforevr/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Lzforevr/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lzforevr/subscriptions",
"organizations_url": "https://api.github.com/users/Lzforevr/orgs",
"repos_url": "https://api.github.com/users/Lzforevr/repos",
"events_url": "https://api.github.com/users/Lzforevr/events{/privacy}",
"received_events_url": "https://api.github.com/users/Lzforevr/received_events",
"type": "User",
"site_admin": false
} | [] | open | false | null | [] | null | 0 | 2024-10-02T15:05:50 | 2024-10-02T15:27:51 | null | NONE | null | true | {
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/59942",
"html_url": "https://github.com/pandas-dev/pandas/pull/59942",
"diff_url": "https://github.com/pandas-dev/pandas/pull/59942.diff",
"patch_url": "https://github.com/pandas-dev/pandas/pull/59942.patch",
"merged_at": null
} |
- [x] closes #59207 (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.
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59942/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59942/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59937 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59937/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59937/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59937/events | https://github.com/pandas-dev/pandas/pull/59937 | 2,561,181,331 | PR_kwDOAA0YD859W2ag | 59,937 | Backport PR #59906 on branch 2.3.x (BLD: Fix armv7 build) | {
"login": "meeseeksmachine",
"id": 39504233,
"node_id": "MDQ6VXNlcjM5NTA0MjMz",
"avatar_url": "https://avatars.githubusercontent.com/u/39504233?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/meeseeksmachine",
"html_url": "https://github.com/meeseeksmachine",
"followers_url": "https://api.github.com/users/meeseeksmachine/followers",
"following_url": "https://api.github.com/users/meeseeksmachine/following{/other_user}",
"gists_url": "https://api.github.com/users/meeseeksmachine/gists{/gist_id}",
"starred_url": "https://api.github.com/users/meeseeksmachine/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/meeseeksmachine/subscriptions",
"organizations_url": "https://api.github.com/users/meeseeksmachine/orgs",
"repos_url": "https://api.github.com/users/meeseeksmachine/repos",
"events_url": "https://api.github.com/users/meeseeksmachine/events{/privacy}",
"received_events_url": "https://api.github.com/users/meeseeksmachine/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 129350,
"node_id": "MDU6TGFiZWwxMjkzNTA=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Build",
"name": "Build",
"color": "75507B",
"default": false,
"description": "Library building on various platforms"
},
{
"id": 2628846204,
"node_id": "MDU6TGFiZWwyNjI4ODQ2MjA0",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/ARM",
"name": "ARM",
"color": "c2e0c6",
"default": false,
"description": "aarch64 architecture"
}
] | open | false | null | [] | {
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/119",
"html_url": "https://github.com/pandas-dev/pandas/milestone/119",
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/119/labels",
"id": 11466880,
"node_id": "MI_kwDOAA0YD84ArviA",
"number": 119,
"title": "2.3",
"description": "on-merge: backport to 2.3.x",
"creator": {
"login": "jorisvandenbossche",
"id": 1020496,
"node_id": "MDQ6VXNlcjEwMjA0OTY=",
"avatar_url": "https://avatars.githubusercontent.com/u/1020496?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/jorisvandenbossche",
"html_url": "https://github.com/jorisvandenbossche",
"followers_url": "https://api.github.com/users/jorisvandenbossche/followers",
"following_url": "https://api.github.com/users/jorisvandenbossche/following{/other_user}",
"gists_url": "https://api.github.com/users/jorisvandenbossche/gists{/gist_id}",
"starred_url": "https://api.github.com/users/jorisvandenbossche/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jorisvandenbossche/subscriptions",
"organizations_url": "https://api.github.com/users/jorisvandenbossche/orgs",
"repos_url": "https://api.github.com/users/jorisvandenbossche/repos",
"events_url": "https://api.github.com/users/jorisvandenbossche/events{/privacy}",
"received_events_url": "https://api.github.com/users/jorisvandenbossche/received_events",
"type": "User",
"site_admin": false
},
"open_issues": 37,
"closed_issues": 70,
"state": "open",
"created_at": "2024-08-20T19:39:44",
"updated_at": "2024-10-03T20:12:23",
"due_on": null,
"closed_at": null
} | 0 | 2024-10-02T10:12:35 | 2024-10-03T07:41:15 | null | CONTRIBUTOR | null | false | {
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/59937",
"html_url": "https://github.com/pandas-dev/pandas/pull/59937",
"diff_url": "https://github.com/pandas-dev/pandas/pull/59937.diff",
"patch_url": "https://github.com/pandas-dev/pandas/pull/59937.patch",
"merged_at": null
} | Backport PR #59906: BLD: Fix armv7 build | null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59937/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59937/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59935 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59935/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59935/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59935/events | https://github.com/pandas-dev/pandas/pull/59935 | 2,560,968,766 | PR_kwDOAA0YD859WH1R | 59,935 | Handling conversion of empty categorical with dtype_backend='pyarrow' | {
"login": "veljanin",
"id": 36128327,
"node_id": "MDQ6VXNlcjM2MTI4MzI3",
"avatar_url": "https://avatars.githubusercontent.com/u/36128327?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/veljanin",
"html_url": "https://github.com/veljanin",
"followers_url": "https://api.github.com/users/veljanin/followers",
"following_url": "https://api.github.com/users/veljanin/following{/other_user}",
"gists_url": "https://api.github.com/users/veljanin/gists{/gist_id}",
"starred_url": "https://api.github.com/users/veljanin/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/veljanin/subscriptions",
"organizations_url": "https://api.github.com/users/veljanin/orgs",
"repos_url": "https://api.github.com/users/veljanin/repos",
"events_url": "https://api.github.com/users/veljanin/events{/privacy}",
"received_events_url": "https://api.github.com/users/veljanin/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 76811,
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug",
"name": "Bug",
"color": "e10c02",
"default": false,
"description": null
},
{
"id": 78527356,
"node_id": "MDU6TGFiZWw3ODUyNzM1Ng==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Categorical",
"name": "Categorical",
"color": "e11d21",
"default": false,
"description": "Categorical Data Type"
}
] | open | false | null | [] | null | 4 | 2024-10-02T08:33:57 | 2024-10-07T20:32:52 | null | NONE | null | false | {
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/59935",
"html_url": "https://github.com/pandas-dev/pandas/pull/59935",
"diff_url": "https://github.com/pandas-dev/pandas/pull/59935.diff",
"patch_url": "https://github.com/pandas-dev/pandas/pull/59935.patch",
"merged_at": null
} | Handling the case where conversion of empty categorical series with specified dtype_backend='pyarrow' in convert_dtypes function results in 1) an error (when there are no defined categories) or 2) in null[pyarrow] dtype (when there are some defined categories).
- [x] Tests added and passed
- [x] Closes #59934
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59935/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59935/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59934 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59934/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59934/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59934/events | https://github.com/pandas-dev/pandas/issues/59934 | 2,560,944,506 | I_kwDOAA0YD86YpOl6 | 59,934 | BUG: Trying to use convert_dtypes with dtype_backend='pyarrow' specified on empty categorical series results in error or null[pyarrow] dtype | {
"login": "veljanin",
"id": 36128327,
"node_id": "MDQ6VXNlcjM2MTI4MzI3",
"avatar_url": "https://avatars.githubusercontent.com/u/36128327?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/veljanin",
"html_url": "https://github.com/veljanin",
"followers_url": "https://api.github.com/users/veljanin/followers",
"following_url": "https://api.github.com/users/veljanin/following{/other_user}",
"gists_url": "https://api.github.com/users/veljanin/gists{/gist_id}",
"starred_url": "https://api.github.com/users/veljanin/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/veljanin/subscriptions",
"organizations_url": "https://api.github.com/users/veljanin/orgs",
"repos_url": "https://api.github.com/users/veljanin/repos",
"events_url": "https://api.github.com/users/veljanin/events{/privacy}",
"received_events_url": "https://api.github.com/users/veljanin/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 76811,
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug",
"name": "Bug",
"color": "e10c02",
"default": false,
"description": null
},
{
"id": 78527356,
"node_id": "MDU6TGFiZWw3ODUyNzM1Ng==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Categorical",
"name": "Categorical",
"color": "e11d21",
"default": false,
"description": "Categorical Data Type"
},
{
"id": 3303158446,
"node_id": "MDU6TGFiZWwzMzAzMTU4NDQ2",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Arrow",
"name": "Arrow",
"color": "f9d0c4",
"default": false,
"description": "pyarrow functionality"
}
] | open | false | null | [] | null | 0 | 2024-10-02T08:22:10 | 2024-10-02T21:04:49 | null | NONE | null | null | null | ### Pandas version checks
- [X] I have checked that this issue has not already been reported.
- [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas.
- [X] I have confirmed this bug exists on the [main branch](https://pandas.pydata.org/docs/dev/getting_started/install.html#installing-the-development-version-of-pandas) of pandas.
### Reproducible Example
```python
import pandas as pd
# example 1
ser1 = pd.Series(pd.Categorical([None] * 5))
converted1 = ser1.convert_dtypes(dtype_backend="pyarrow")
# example 2
ser2 = pd.Series(pd.Categorical([None] * 5, categories=["S1", "S2"]))
converted2 = ser2.convert_dtypes(dtype_backend="pyarrow")
```
### Issue Description
Trying to convert categorical series with empty categories results in `pyarrow.lib.ArrowNotImplementedError: NumPyConverter doesn't implement <null> conversion. `.
Trying to convert categorical series with non-empty categories returns null[pyarrow] dtype.
This is inconsistent with regular behavior when converting categoricals - if series is not empty, convert_dtypes call returns categorical dtype (essentially ignoring the requested pyarrow backend conversion).
I encountered this issue when trying to read files (like parquet, spss, ...) where some categorical variables are empty...
### Expected Behavior
Returning categorical dtype with propagated categories, and not raising errors.
### Installed Versions
<details>
INSTALLED VERSIONS
------------------
commit : 00855f81bd84cc6ed9ae42c5f66916b2208dbe04
python : 3.12.0
python-bits : 64
OS : Windows
OS-release : 11
Version : 10.0.22631
machine : AMD64
processor : Intel64 Family 6 Model 165 Stepping 2, GenuineIntel
byteorder : little
LC_ALL : None
LANG : None
LOCALE : English_United States.1252
pandas : 3.0.0.dev0+1536.g00855f81bd
numpy : 1.26.4
dateutil : 2.9.0.post0
pip : 24.2
Cython : 3.0.11
sphinx : 8.0.2
IPython : 8.27.0
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : 4.12.3
blosc : None
bottleneck : 1.4.0
fastparquet : 2024.5.0
fsspec : 2024.9.0
html5lib : 1.1
hypothesis : 6.112.2
gcsfs : 2024.9.0post1
jinja2 : 3.1.4
lxml.etree : 5.3.0
matplotlib : 3.9.2
numba : 0.60.0
numexpr : 2.10.1
odfpy : None
openpyxl : 3.1.5
psycopg2 : 2.9.9
pymysql : 1.4.6
pyarrow : 17.0.0
pyreadstat : 1.2.7
pytest : 8.3.3
python-calamine : None
pytz : 2024.2
pyxlsb : 1.0.10
s3fs : 2024.9.0
scipy : 1.14.1
sqlalchemy : 2.0.35
tables : 3.10.1
tabulate : 0.9.0
xarray : 2024.9.0
xlrd : 2.0.1
xlsxwriter : 3.2.0
zstandard : 0.23.0
tzdata : 2024.2
qtpy : None
pyqt5 : None
</details>
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59934/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59934/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59933 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59933/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59933/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59933/events | https://github.com/pandas-dev/pandas/issues/59933 | 2,560,390,330 | I_kwDOAA0YD86YnHS6 | 59,933 | BUG: locset with Series as column key fails inconsistently | {
"login": "sfc-gh-rdurrani",
"id": 149019786,
"node_id": "U_kgDOCOHcig",
"avatar_url": "https://avatars.githubusercontent.com/u/149019786?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/sfc-gh-rdurrani",
"html_url": "https://github.com/sfc-gh-rdurrani",
"followers_url": "https://api.github.com/users/sfc-gh-rdurrani/followers",
"following_url": "https://api.github.com/users/sfc-gh-rdurrani/following{/other_user}",
"gists_url": "https://api.github.com/users/sfc-gh-rdurrani/gists{/gist_id}",
"starred_url": "https://api.github.com/users/sfc-gh-rdurrani/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sfc-gh-rdurrani/subscriptions",
"organizations_url": "https://api.github.com/users/sfc-gh-rdurrani/orgs",
"repos_url": "https://api.github.com/users/sfc-gh-rdurrani/repos",
"events_url": "https://api.github.com/users/sfc-gh-rdurrani/events{/privacy}",
"received_events_url": "https://api.github.com/users/sfc-gh-rdurrani/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 76811,
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug",
"name": "Bug",
"color": "e10c02",
"default": false,
"description": null
},
{
"id": 2822098,
"node_id": "MDU6TGFiZWwyODIyMDk4",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Indexing",
"name": "Indexing",
"color": "0b02e1",
"default": false,
"description": "Related to indexing on series/frames, not to indexes themselves"
}
] | open | false | null | [] | null | 2 | 2024-10-01T23:40:51 | 2024-10-05T22:50:57 | null | NONE | null | null | null | ### Pandas version checks
- [X] I have checked that this issue has not already been reported.
- [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas.
- [ ] I have confirmed this bug exists on the [main branch](https://pandas.pydata.org/docs/dev/getting_started/install.html#installing-the-development-version-of-pandas) of pandas.
### Reproducible Example
```python
>>> import pandas as pd
>>> df = pd.DataFrame([[1, 2, 3], [4, 5, 6]], columns=list("ABC"))
>>> df.loc[:, pd.Series(['A', 'C'])] = pd.Series([10, 20, 30]) # succeeds
>>> df
A B C
0 10 2 20
1 10 5 20
>>> df.loc[:, pd.Series(['A', 'B', 'C'])] = pd.Series([10, 20, 30]) # fails
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
File ~/.miniconda3/envs/snowpark/lib/python3.10/site-packages/pandas/core/internals/blocks.py:1429, in Block.setitem(self, indexer, value, using_cow)
1428 try:
-> 1429 values[indexer] = casted
1430 except (TypeError, ValueError) as err:
ValueError: shape mismatch: value array of shape (2,) could not be broadcast to indexing result of shape (2,3)
The above exception was the direct cause of the following exception:
ValueError Traceback (most recent call last)
Cell In[5], line 1
----> 1 df.loc[:, pd.Series(['A', 'B', 'C'])] = pd.Series([10, 20, 30])
File ~/.miniconda3/envs/snowpark/lib/python3.10/site-packages/pandas/core/indexing.py:911, in _LocationIndexer.__setitem__(self, key, value)
908 self._has_valid_setitem_indexer(key)
910 iloc = self if self.name == "iloc" else self.obj.iloc
--> 911 iloc._setitem_with_indexer(indexer, value, self.name)
File ~/.miniconda3/envs/snowpark/lib/python3.10/site-packages/pandas/core/indexing.py:1944, in _iLocIndexer._setitem_with_indexer(self, indexer, value, name)
1942 self._setitem_with_indexer_split_path(indexer, value, name)
1943 else:
-> 1944 self._setitem_single_block(indexer, value, name)
File ~/.miniconda3/envs/snowpark/lib/python3.10/site-packages/pandas/core/indexing.py:2218, in _iLocIndexer._setitem_single_block(self, indexer, value, name)
2215 self.obj._check_is_chained_assignment_possible()
2217 # actually do the set
-> 2218 self.obj._mgr = self.obj._mgr.setitem(indexer=indexer, value=value)
2219 self.obj._maybe_update_cacher(clear=True, inplace=True)
File ~/.miniconda3/envs/snowpark/lib/python3.10/site-packages/pandas/core/internals/managers.py:415, in BaseBlockManager.setitem(self, indexer, value, warn)
411 # No need to split if we either set all columns or on a single block
412 # manager
413 self = self.copy()
--> 415 return self.apply("setitem", indexer=indexer, value=value)
File ~/.miniconda3/envs/snowpark/lib/python3.10/site-packages/pandas/core/internals/managers.py:363, in BaseBlockManager.apply(self, f, align_keys, **kwargs)
361 applied = b.apply(f, **kwargs)
362 else:
--> 363 applied = getattr(b, f)(**kwargs)
364 result_blocks = extend_blocks(applied, result_blocks)
366 out = type(self).from_blocks(result_blocks, self.axes)
File ~/.miniconda3/envs/snowpark/lib/python3.10/site-packages/pandas/core/internals/blocks.py:1432, in Block.setitem(self, indexer, value, using_cow)
1430 except (TypeError, ValueError) as err:
1431 if is_list_like(casted):
-> 1432 raise ValueError(
1433 "setting an array element with a sequence."
1434 ) from err
1435 raise
1436 return self
ValueError: setting an array element with a sequence.
>>> In [7]: df.loc[:, pd.Series(['A'])] = pd.Series([10, 20, 30]) # Fails
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
File ~/.miniconda3/envs/snowpark/lib/python3.10/site-packages/pandas/core/internals/blocks.py:1429, in Block.setitem(self, indexer, value, using_cow)
1428 try:
-> 1429 values[indexer] = casted
1430 except (TypeError, ValueError) as err:
ValueError: shape mismatch: value array of shape (2,) could not be broadcast to indexing result of shape (2,1)
The above exception was the direct cause of the following exception:
ValueError Traceback (most recent call last)
Cell In[7], line 1
----> 1 df.loc[:, pd.Series(['A'])] = pd.Series([10, 20, 30])
File ~/.miniconda3/envs/snowpark/lib/python3.10/site-packages/pandas/core/indexing.py:911, in _LocationIndexer.__setitem__(self, key, value)
908 self._has_valid_setitem_indexer(key)
910 iloc = self if self.name == "iloc" else self.obj.iloc
--> 911 iloc._setitem_with_indexer(indexer, value, self.name)
File ~/.miniconda3/envs/snowpark/lib/python3.10/site-packages/pandas/core/indexing.py:1944, in _iLocIndexer._setitem_with_indexer(self, indexer, value, name)
1942 self._setitem_with_indexer_split_path(indexer, value, name)
1943 else:
-> 1944 self._setitem_single_block(indexer, value, name)
File ~/.miniconda3/envs/snowpark/lib/python3.10/site-packages/pandas/core/indexing.py:2218, in _iLocIndexer._setitem_single_block(self, indexer, value, name)
2215 self.obj._check_is_chained_assignment_possible()
2217 # actually do the set
-> 2218 self.obj._mgr = self.obj._mgr.setitem(indexer=indexer, value=value)
2219 self.obj._maybe_update_cacher(clear=True, inplace=True)
File ~/.miniconda3/envs/snowpark/lib/python3.10/site-packages/pandas/core/internals/managers.py:415, in BaseBlockManager.setitem(self, indexer, value, warn)
411 # No need to split if we either set all columns or on a single block
412 # manager
413 self = self.copy()
--> 415 return self.apply("setitem", indexer=indexer, value=value)
File ~/.miniconda3/envs/snowpark/lib/python3.10/site-packages/pandas/core/internals/managers.py:363, in BaseBlockManager.apply(self, f, align_keys, **kwargs)
361 applied = b.apply(f, **kwargs)
362 else:
--> 363 applied = getattr(b, f)(**kwargs)
364 result_blocks = extend_blocks(applied, result_blocks)
366 out = type(self).from_blocks(result_blocks, self.axes)
File ~/.miniconda3/envs/snowpark/lib/python3.10/site-packages/pandas/core/internals/blocks.py:1432, in Block.setitem(self, indexer, value, using_cow)
1430 except (TypeError, ValueError) as err:
1431 if is_list_like(casted):
-> 1432 raise ValueError(
1433 "setting an array element with a sequence."
1434 ) from err
1435 raise
1436 return self
ValueError: setting an array element with a sequence
>>> df = pd.DataFrame([[1, 2, 3], [4, 5, 6], [7, 8, 9]], columns=list("ABC"))
>>> df.loc[:, pd.Series(['A', 'B', 'C'])] = pd.Series([10, 20, 30]) # Succeeds
>>> df
A B C
0 10 20 30
1 10 20 30
2 10 20 30
```
### Issue Description
It seems that we can only provide as many column indexers in the Series key for the column as are rows, but all of the above examples should succeed.
### Expected Behavior
Columns that are indexed should be set with the corresponding value (determined by position).
### Installed Versions
<details>
INSTALLED VERSIONS
------------------
commit : bdc79c146c2e32f2cab629be240f01658cfb6cc2
python : 3.10.14.final.0
python-bits : 64
OS : Darwin
OS-release : 23.6.0
Version : Darwin Kernel Version 23.6.0: Mon Jul 29 21:13:04 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T6020
machine : arm64
processor : arm
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 2.2.1
numpy : 1.26.4
pytz : 2024.1
dateutil : 2.9.0.post0
setuptools : 72.1.0
pip : 24.2
Cython : None
pytest : 7.4.4
hypothesis : None
sphinx : 5.0.2
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 3.1.4
IPython : 8.27.0
pandas_datareader : None
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : 4.12.3
bottleneck : None
dataframe-api-compat : None
fastparquet : None
fsspec : 2024.6.1
gcsfs : None
matplotlib : 3.9.2
numba : None
numexpr : None
odfpy : None
openpyxl : 3.1.5
pandas_gbq : None
pyarrow : 17.0.0
pyreadstat : None
python-calamine : None
pyxlsb : None
s3fs : None
scipy : 1.14.1
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
zstandard : None
tzdata : 2024.1
qtpy : None
pyqt5 : None
</details>
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59933/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59933/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59932 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59932/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59932/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59932/events | https://github.com/pandas-dev/pandas/issues/59932 | 2,559,779,205 | I_kwDOAA0YD86YkyGF | 59,932 | BUG: np.nan_to_num change pandas DataFrame in place when copy = True | {
"login": "lil-blue-curve",
"id": 183429179,
"node_id": "U_kgDOCu7oOw",
"avatar_url": "https://avatars.githubusercontent.com/u/183429179?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/lil-blue-curve",
"html_url": "https://github.com/lil-blue-curve",
"followers_url": "https://api.github.com/users/lil-blue-curve/followers",
"following_url": "https://api.github.com/users/lil-blue-curve/following{/other_user}",
"gists_url": "https://api.github.com/users/lil-blue-curve/gists{/gist_id}",
"starred_url": "https://api.github.com/users/lil-blue-curve/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lil-blue-curve/subscriptions",
"organizations_url": "https://api.github.com/users/lil-blue-curve/orgs",
"repos_url": "https://api.github.com/users/lil-blue-curve/repos",
"events_url": "https://api.github.com/users/lil-blue-curve/events{/privacy}",
"received_events_url": "https://api.github.com/users/lil-blue-curve/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 76811,
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug",
"name": "Bug",
"color": "e10c02",
"default": false,
"description": null
},
{
"id": 76865106,
"node_id": "MDU6TGFiZWw3Njg2NTEwNg==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Compat",
"name": "Compat",
"color": "0052cc",
"default": false,
"description": "pandas objects compatability with Numpy or Python functions"
}
] | open | false | null | [] | null | 1 | 2024-10-01T17:07:38 | 2024-10-01T21:03:57 | null | NONE | null | null | null | ### Pandas version checks
- [X] I have checked that this issue has not already been reported.
- [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas.
- [X] I have confirmed this bug exists on the [main branch](https://pandas.pydata.org/docs/dev/getting_started/install.html#installing-the-development-version-of-pandas) of pandas.
### Reproducible Example
```python
import numpy as np
import pandas as pd
x = pd.DataFrame([np.nan])
np.nan_to_num(x, copy=True)
print(x)
```
### Issue Description
Result x is changed to 0.0 even when nan_to_num is called with copy=True.
This issue is originally reported to numpy [here](https://github.com/numpy/numpy/issues/27487). Looks like pandas ignores `copy=True` NumPy passes?
### Expected Behavior
x should not be changed when copy=True.
### Installed Versions
<details>
INSTALLED VERSIONS
------------------
commit : 0691c5cf90477d3503834d983f69350f250a6ff7
python : 3.11.8
python-bits : 64
OS : Linux
OS-release : 5.10.0-smp-1100.466.602.1
Version : #1 [v5.10.0-1100.466.602.1] SMP @1708156698
machine : x86_64
processor :
byteorder : little
LC_ALL : None
LANG : None
LOCALE : en_US.UTF-8
pandas : 2.2.3
numpy : 2.1.1
pytz : 2024.1
dateutil : 2.8.1
pip : None
Cython : None
sphinx : None
IPython : None
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : None
blosc : None
bottleneck : None
dataframe-api-compat : None
fastparquet : None
fsspec : None
html5lib : None
hypothesis : None
gcsfs : None
jinja2 : None
lxml.etree : 5.3.0
matplotlib : None
numba : None
numexpr : 2.8.7
odfpy : None
openpyxl : 3.1.2
pandas_gbq : None
psycopg2 : None
pymysql : None
pyarrow : None
pyreadstat : None
pytest : None
python-calamine : None
pyxlsb : None
s3fs : None
scipy : 1.13.1
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : 2.0.1
xlsxwriter : None
zstandard : None
tzdata : None
qtpy : None
pyqt5 : None
</details>
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59932/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59932/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59931 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59931/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59931/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59931/events | https://github.com/pandas-dev/pandas/issues/59931 | 2,559,117,094 | I_kwDOAA0YD86YiQcm | 59,931 | ENH: Add support to customize time format and more detailed error handling information for to_time | {
"login": "Lzforevr",
"id": 139556927,
"node_id": "U_kgDOCFF4Pw",
"avatar_url": "https://avatars.githubusercontent.com/u/139556927?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Lzforevr",
"html_url": "https://github.com/Lzforevr",
"followers_url": "https://api.github.com/users/Lzforevr/followers",
"following_url": "https://api.github.com/users/Lzforevr/following{/other_user}",
"gists_url": "https://api.github.com/users/Lzforevr/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Lzforevr/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lzforevr/subscriptions",
"organizations_url": "https://api.github.com/users/Lzforevr/orgs",
"repos_url": "https://api.github.com/users/Lzforevr/repos",
"events_url": "https://api.github.com/users/Lzforevr/events{/privacy}",
"received_events_url": "https://api.github.com/users/Lzforevr/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 76812,
"node_id": "MDU6TGFiZWw3NjgxMg==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Enhancement",
"name": "Enhancement",
"color": "4E9A06",
"default": false,
"description": null
},
{
"id": 1954720290,
"node_id": "MDU6TGFiZWwxOTU0NzIwMjkw",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Needs%20Triage",
"name": "Needs Triage",
"color": "0052cc",
"default": false,
"description": "Issue that has not been reviewed by a pandas team member"
}
] | open | false | null | [] | null | 1 | 2024-10-01T12:44:14 | 2024-10-07T06:36:15 | null | NONE | null | null | null | ### Feature Type
- [ ] Adding new functionality to pandas
- [X] Changing existing functionality in pandas
- [ ] Removing existing functionality in pandas
### Problem Description
**Path:** pandas/core/tools/times.py
**Func:** to_time
Though to_time is able to handle several common time formats, I still wish to enhance its versatility and adaptability by customizing time format. By the way, customized error handling infos are also of use (though simple).
It's my pleasure if you agree with my changes and I'd love to make PR!
### Feature Description
I've modified **times.py** for the above enhancements, and I've made a test demo to show its new feature in **times_test.py**.
1. Improved compatibility: Allows users to customize the time format, which improves the versatility and adaptability of the function.
2. Enhanced error handling: Provide more detailed error information for easy debugging and problem location.
### Alternative Solutions
The source code are as follows:
1. new times.py
``` python
# modfied times.py
from __future__ import annotations
from datetime import datetime, time
from typing import TYPE_CHECKING, List, Union
import numpy as np
from pandas._libs.lib import is_list_like
from pandas.core.dtypes.generic import ABCIndex, ABCSeries
from pandas.core.dtypes.missing import notna
if TYPE_CHECKING:
from pandas._typing import DateTimeErrorChoices
def to_time(
arg,
format: Union[str, List[str], None] = None,
infer_time_format: bool = False,
errors: DateTimeErrorChoices = "raise",
custom_formats: List[str] = None,
):
"""
Parse time strings to time objects using fixed strptime formats ("%H:%M",
"%H%M", "%I:%M%p", "%I%M%p", "%H:%M:%S", "%H%M%S", "%I:%M:%S%p",
"%I%M%S%p") and additional custom formats.
Use infer_time_format if all the strings are in the same format to speed
up conversion.
Parameters
----------
arg : string in time format, datetime.time, list, tuple, 1-d array, Series
format : str or list of str, default None
Format(s) used to convert arg into a time object. If None, fixed
formats are used.
infer_time_format: bool, default False
Infer the time format based on the first non-NaN element. If all
strings are in the same format, this will speed up conversion.
errors : {'raise', 'coerce'}, default 'raise'
- If 'raise', then invalid parsing will raise an exception
- If 'coerce', then invalid parsing will be set as None
custom_formats : list of str, default None
Additional custom time formats to use.
Returns
-------
datetime.time or list of datetime.time
"""
if errors not in ("raise", "coerce"):
raise ValueError("errors must be one of 'raise', or 'coerce'.")
def _convert_listlike(arg, format):
if isinstance(arg, (list, tuple)):
arg = np.array(arg, dtype="O")
elif getattr(arg, "ndim", 1) > 1:
raise TypeError(
"arg must be a string, datetime, list, tuple, 1-d array, or Series"
)
arg = np.asarray(arg, dtype="O")
if infer_time_format and format is None:
format = _guess_time_format_for_array(arg)
times = []
if format is not None:
if isinstance(format, list):
for element in arg:
for fmt in format:
try:
times.append(datetime.strptime(element, fmt).time())
break
except (ValueError, TypeError):
continue
else:
if errors == "raise":
msg = (
f"Cannot convert {element} to a time with given "f"formats {format}")
raise ValueError(msg)
times.append(None)
else:
for element in arg:
try:
times.append(datetime.strptime(element, format).time())
except (ValueError, TypeError) as err:
if errors == "raise":
msg = (f"Cannot convert {element} to a time withgiven "f"format {format}")
raise ValueError(msg) from err
times.append(None)
else:
formats = _time_formats + (custom_formats or [])
for element in arg:
time_object = None
try:
time_object = time.fromisoformat(element)
except (ValueError, TypeError):
for time_format in formats:
try:
time_object = datetime.strptime(element, time_format).time()
break
except (ValueError, TypeError):
continue
if time_object is not None:
times.append(time_object)
elif errors == "raise":
raise ValueError(f"Cannot convert arg {arg} to a time")
else:
times.append(None)
return times
if arg is None:
return arg
elif isinstance(arg, time):
return arg
elif isinstance(arg, ABCSeries):
values = _convert_listlike(arg._values, format)
return arg._constructor(values, index=arg.index, name=arg.name)
elif isinstance(arg, ABCIndex):
return _convert_listlike(arg, format)
elif is_list_like(arg):
return _convert_listlike(arg, format)
return _convert_listlike(np.array([arg]), format)[0]
# Fixed time formats for time parsing
_time_formats = [
"%H:%M",
"%H%M",
"%I:%M%p",
"%I%M%p",
"%H:%M:%S",
"%H%M%S",
"%I:%M:%S%p",
"%I%M%S%p",
]
def _guess_time_format_for_array(arr):
# Try to guess the format based on the first non-NaN element
non_nan_elements = notna(arr).nonzero()[0]
if len(non_nan_elements):
element = arr[non_nan_elements[0]]
for time_format in _time_formats:
try:
datetime.strptime(element, time_format)
return time_format
except ValueError:
pass
return None
```
2. test demo (under the same directory of times.py)
``` python
# times_test.py
from datetime import time
import pandas as pd
import numpy as np
from times import to_time
# Test code
def test_to_time():
"""
- Tests the `to_time` function with various input formats
and demonstrates how it handles invalid inputs.
- return: None
"""
# Single time string
single_time_str = "12:30"
print("Single time string:", to_time(single_time_str))
# Time object
time_obj = time(12, 30)
print("Time object:", to_time(time_obj))
# List of time strings
time_list = ["12:30", "13:45"]
print("List of time strings:", to_time(time_list))
# NumPy array of time strings
time_array = np.array(["12:30", "13:45"])
print("NumPy array of time strings:", to_time(time_array))
# Pandas Series of time strings
time_series = pd.Series(["12:30", "13:45"])
print("Pandas Series of time strings:", to_time(time_series))
# Error handling
invalid_list = ["12:30", "invalid"]
try:
print("Invalid list:", to_time(invalid_list))
except ValueError as e:
print("Error:", e)
# Error handling (coerce)
invalid_list_coerce = ["12:30", "invalid"]
print("Invalid list (coerce):", to_time(invalid_list_coerce, errors="coerce"))
# Custom format
custom_format = ["%H:%M:%S.%f"]
custom_time_list = ["12:30:45.123456", "13:45:00.987654"]
print("Custom time list:", to_time(custom_time_list, custom_formats=custom_format))
# Inferred time list
inferred_time_list = ["12:30", "13:45"]
print("Inferred time list:", to_time(inferred_time_list, infer_time_format=True))
# ISO 8601 time list
iso_time_list = ["12:30:45", "13:45:00"]
print("ISO 8601 time list:", to_time(iso_time_list))
test_to_time()
```
3. result for times_test.py
``` bash
Single time string: 12:30:00
Time object: 12:30:00
List of time strings: [datetime.time(12, 30), datetime.time(13, 45)]
NumPy array of time strings: [datetime.time(12, 30), datetime.time(13, 45)]
Pandas Series of time strings: 0 12:30:00
1 13:45:00
dtype: object
Error: Cannot convert arg ['12:30' 'invalid'] to a time
Invalid list (coerce): [datetime.time(12, 30), None]
Custom time list: [datetime.time(12, 30, 45, 123456), datetime.time(13, 45, 0, 987654)]
Inferred time list: [datetime.time(12, 30), datetime.time(13, 45)]
ISO 8601 time list: [datetime.time(12, 30, 45), datetime.time(13, 45)]
```
### Additional Context
_No response_ | null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59931/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59931/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59922 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59922/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59922/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59922/events | https://github.com/pandas-dev/pandas/issues/59922 | 2,555,190,802 | I_kwDOAA0YD86YTR4S | 59,922 | BUG: cannot filter an empty DataFrame by a non-numeric condition | {
"login": "sam-s",
"id": 1596894,
"node_id": "MDQ6VXNlcjE1OTY4OTQ=",
"avatar_url": "https://avatars.githubusercontent.com/u/1596894?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/sam-s",
"html_url": "https://github.com/sam-s",
"followers_url": "https://api.github.com/users/sam-s/followers",
"following_url": "https://api.github.com/users/sam-s/following{/other_user}",
"gists_url": "https://api.github.com/users/sam-s/gists{/gist_id}",
"starred_url": "https://api.github.com/users/sam-s/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sam-s/subscriptions",
"organizations_url": "https://api.github.com/users/sam-s/orgs",
"repos_url": "https://api.github.com/users/sam-s/repos",
"events_url": "https://api.github.com/users/sam-s/events{/privacy}",
"received_events_url": "https://api.github.com/users/sam-s/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 76811,
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug",
"name": "Bug",
"color": "e10c02",
"default": false,
"description": null
},
{
"id": 2822098,
"node_id": "MDU6TGFiZWwyODIyMDk4",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Indexing",
"name": "Indexing",
"color": "0b02e1",
"default": false,
"description": "Related to indexing on series/frames, not to indexes themselves"
},
{
"id": 2365504893,
"node_id": "MDU6TGFiZWwyMzY1NTA0ODkz",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Closing%20Candidate",
"name": "Closing Candidate",
"color": "be21f2",
"default": false,
"description": "May be closeable, needs more eyeballs"
}
] | open | false | null | [] | null | 4 | 2024-09-29T22:20:53 | 2024-10-08T05:10:53 | null | NONE | null | null | null | ### Pandas version checks
- [X] I have checked that this issue has not already been reported.
- [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas.
- [ ] I have confirmed this bug exists on the [main branch](https://pandas.pydata.org/docs/dev/getting_started/install.html#installing-the-development-version-of-pandas) of pandas.
### Reproducible Example
```python
import pandas as pd
f = pd.DataFrame()
# this works as expected, returning an empty frame
f[f.index < 5]
# this fails
f[f.index > pd.Timestamp("2024-10-10")]
```
### Issue Description
filtering an empty `DataFrame` by a non-numeric filter fails with
> TypeError: '>' not supported between instances of 'numpy.ndarray' and 'Timestamp'
### Expected Behavior
an empty frame should be returned, just like with a numeric condition
### Installed Versions
<details>
INSTALLED VERSIONS
------------------
commit : 0691c5cf90477d3503834d983f69350f250a6ff7
python : 3.12.6
python-bits : 64
OS : Windows
OS-release : 10
Version : 10.0.19045
machine : AMD64
processor : Intel64 Family 6 Model 85 Stepping 7, GenuineIntel
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : English_United States.1252
pandas : 2.2.3
numpy : 2.1.1
pytz : 2024.1
dateutil : 2.8.2
pip : 24.2
Cython : None
sphinx : None
IPython : 8.27.0
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : 4.12.3
blosc : None
bottleneck : None
dataframe-api-compat : None
fastparquet : None
fsspec : 2024.9.0
html5lib : None
hypothesis : None
gcsfs : None
jinja2 : 3.1.4
lxml.etree : 5.3.0
matplotlib : 3.9.2
numba : None
numexpr : None
odfpy : None
openpyxl : 3.1.2
pandas_gbq : None
psycopg2 : None
pymysql : None
pyarrow : None
pyreadstat : None
pytest : None
python-calamine : None
pyxlsb : None
s3fs : None
scipy : 1.14.1
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlsxwriter : None
zstandard : 0.23.0
tzdata : 2024.2
qtpy : 2.4.1
pyqt5 : None
</details>
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59922/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59922/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59916 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59916/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59916/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59916/events | https://github.com/pandas-dev/pandas/pull/59916 | 2,554,474,168 | PR_kwDOAA0YD859AOU- | 59,916 | ENH: Be able to add lines for all index levels, not just visible ones [fix #59877] | {
"login": "edbennett",
"id": 1698405,
"node_id": "MDQ6VXNlcjE2OTg0MDU=",
"avatar_url": "https://avatars.githubusercontent.com/u/1698405?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/edbennett",
"html_url": "https://github.com/edbennett",
"followers_url": "https://api.github.com/users/edbennett/followers",
"following_url": "https://api.github.com/users/edbennett/following{/other_user}",
"gists_url": "https://api.github.com/users/edbennett/gists{/gist_id}",
"starred_url": "https://api.github.com/users/edbennett/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/edbennett/subscriptions",
"organizations_url": "https://api.github.com/users/edbennett/orgs",
"repos_url": "https://api.github.com/users/edbennett/repos",
"events_url": "https://api.github.com/users/edbennett/events{/privacy}",
"received_events_url": "https://api.github.com/users/edbennett/received_events",
"type": "User",
"site_admin": false
} | [] | open | false | null | [] | null | 0 | 2024-09-28T19:56:21 | 2024-10-03T09:11:19 | null | NONE | null | false | {
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/59916",
"html_url": "https://github.com/pandas-dev/pandas/pull/59916",
"diff_url": "https://github.com/pandas-dev/pandas/pull/59916.diff",
"patch_url": "https://github.com/pandas-dev/pandas/pull/59916.patch",
"merged_at": null
} | Per discussion in #59877, add an `-invisible` suffix that can be added to the index selection in the `clines` option to `Styler.to_latex()`, allowing hidden indices to be used when deciding where to place lines between rows.
This approach does not break compatibility with existing code, at the expense of starting a potential combinatoric explosion of options being combined into this one string. There may be a more elegant and/or expressive way of achieving the same result, at the cost of breaking compatibility (or needing to maintain two interfaces until the previous one is deprecated).
- [x] 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. [No new arguments, methods, or functions added, outside of tests.]
- [x] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59916/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59916/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59910 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59910/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59910/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59910/events | https://github.com/pandas-dev/pandas/pull/59910 | 2,552,802,383 | PR_kwDOAA0YD8586liq | 59,910 | CI: fix wrong syntax in CI env yml files (mamba 2.0 compat) | {
"login": "jorisvandenbossche",
"id": 1020496,
"node_id": "MDQ6VXNlcjEwMjA0OTY=",
"avatar_url": "https://avatars.githubusercontent.com/u/1020496?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/jorisvandenbossche",
"html_url": "https://github.com/jorisvandenbossche",
"followers_url": "https://api.github.com/users/jorisvandenbossche/followers",
"following_url": "https://api.github.com/users/jorisvandenbossche/following{/other_user}",
"gists_url": "https://api.github.com/users/jorisvandenbossche/gists{/gist_id}",
"starred_url": "https://api.github.com/users/jorisvandenbossche/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jorisvandenbossche/subscriptions",
"organizations_url": "https://api.github.com/users/jorisvandenbossche/orgs",
"repos_url": "https://api.github.com/users/jorisvandenbossche/repos",
"events_url": "https://api.github.com/users/jorisvandenbossche/events{/privacy}",
"received_events_url": "https://api.github.com/users/jorisvandenbossche/received_events",
"type": "User",
"site_admin": false
} | [] | open | false | null | [] | null | 2 | 2024-09-27T12:26:06 | 2024-09-28T11:00:42 | null | MEMBER | null | false | {
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/59910",
"html_url": "https://github.com/pandas-dev/pandas/pull/59910",
"diff_url": "https://github.com/pandas-dev/pandas/pull/59910.diff",
"patch_url": "https://github.com/pandas-dev/pandas/pull/59910.patch",
"merged_at": null
} | All CI is failing with the new mamba 2.0 release. But it seems this is because we had invalid syntax (pip extras syntax) in our environment files, where mamba now fails on (previously used conda for parsing the yml files).
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59910/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59910/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59909 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59909/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59909/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59909/events | https://github.com/pandas-dev/pandas/pull/59909 | 2,552,748,177 | PR_kwDOAA0YD8586ZfM | 59,909 | ENH: set __module__ for objects in pandas pd.CategoricalDtype API | {
"login": "Amir-101",
"id": 44722829,
"node_id": "MDQ6VXNlcjQ0NzIyODI5",
"avatar_url": "https://avatars.githubusercontent.com/u/44722829?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Amir-101",
"html_url": "https://github.com/Amir-101",
"followers_url": "https://api.github.com/users/Amir-101/followers",
"following_url": "https://api.github.com/users/Amir-101/following{/other_user}",
"gists_url": "https://api.github.com/users/Amir-101/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Amir-101/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Amir-101/subscriptions",
"organizations_url": "https://api.github.com/users/Amir-101/orgs",
"repos_url": "https://api.github.com/users/Amir-101/repos",
"events_url": "https://api.github.com/users/Amir-101/events{/privacy}",
"received_events_url": "https://api.github.com/users/Amir-101/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 13101118,
"node_id": "MDU6TGFiZWwxMzEwMTExOA==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Output-Formatting",
"name": "Output-Formatting",
"color": "ededed",
"default": false,
"description": "__repr__ of pandas objects, to_string"
}
] | open | false | null | [] | null | 0 | 2024-09-27T11:59:31 | 2024-10-02T19:49:20 | null | NONE | null | false | {
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/59909",
"html_url": "https://github.com/pandas-dev/pandas/pull/59909",
"diff_url": "https://github.com/pandas-dev/pandas/pull/59909.diff",
"patch_url": "https://github.com/pandas-dev/pandas/pull/59909.patch",
"merged_at": null
} | Modified top-level name object for all Types class in the Dtype module by importing the set module decorator and decorating the class. Tested the modification by adding an assert statement to the already existing test_set_module test function
- [x] xref #55178
- [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.
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59909/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59909/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59908 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59908/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59908/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59908/events | https://github.com/pandas-dev/pandas/issues/59908 | 2,552,482,698 | I_kwDOAA0YD86YI8uK | 59,908 | BUG: user defined function does not work with `DataFrame.apply` | {
"login": "shobsi",
"id": 10303222,
"node_id": "MDQ6VXNlcjEwMzAzMjIy",
"avatar_url": "https://avatars.githubusercontent.com/u/10303222?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/shobsi",
"html_url": "https://github.com/shobsi",
"followers_url": "https://api.github.com/users/shobsi/followers",
"following_url": "https://api.github.com/users/shobsi/following{/other_user}",
"gists_url": "https://api.github.com/users/shobsi/gists{/gist_id}",
"starred_url": "https://api.github.com/users/shobsi/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/shobsi/subscriptions",
"organizations_url": "https://api.github.com/users/shobsi/orgs",
"repos_url": "https://api.github.com/users/shobsi/repos",
"events_url": "https://api.github.com/users/shobsi/events{/privacy}",
"received_events_url": "https://api.github.com/users/shobsi/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 76811,
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug",
"name": "Bug",
"color": "e10c02",
"default": false,
"description": null
},
{
"id": 71268330,
"node_id": "MDU6TGFiZWw3MTI2ODMzMA==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/MultiIndex",
"name": "MultiIndex",
"color": "207de5",
"default": false,
"description": null
},
{
"id": 219960758,
"node_id": "MDU6TGFiZWwyMTk5NjA3NTg=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Needs%20Discussion",
"name": "Needs Discussion",
"color": "207de5",
"default": false,
"description": "Requires discussion from core team before further action"
},
{
"id": 1741841389,
"node_id": "MDU6TGFiZWwxNzQxODQxMzg5",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/API%20-%20Consistency",
"name": "API - Consistency",
"color": "b60205",
"default": false,
"description": "Internal Consistency of API/Behavior"
}
] | open | false | null | [] | null | 1 | 2024-09-27T09:41:54 | 2024-09-28T11:56:18 | null | NONE | null | null | null | ### Pandas version checks
- [X] I have checked that this issue has not already been reported.
- [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas.
- [X] I have confirmed this bug exists on the [main branch](https://pandas.pydata.org/docs/dev/getting_started/install.html#installing-the-development-version-of-pandas) of pandas.
### Reproducible Example
```python
import pandas as pd
df = pd.DataFrame(
[[1]],
index=pd.MultiIndex.from_frame(
pd.DataFrame(
{
"idx0": pd.Series("a", dtype=pd.StringDtype()),
"idx1": pd.Series(100, dtype=pd.Int64Dtype())
}
)
),
)
df.loc[("a", 100)].name
```
```
('a', np.int64(100))
```
```python
def foo(row): return row.name[1].item()
foo(df.loc[("a", 100)])
```
```
100
```
```python
df.apply(foo, axis=1)
```
```
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/google/home/shobs/code/bigframes1/venv/lib/python3.12/site-packages/pandas/core/frame.py", line 10374, in apply
return op.apply().__finalize__(self, method="apply")
^^^^^^^^^^
File "/usr/local/google/home/shobs/code/bigframes1/venv/lib/python3.12/site-packages/pandas/core/apply.py", line 916, in apply
return self.apply_standard()
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/google/home/shobs/code/bigframes1/venv/lib/python3.12/site-packages/pandas/core/apply.py", line 1063, in apply_standard
results, res_index = self.apply_series_generator()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/google/home/shobs/code/bigframes1/venv/lib/python3.12/site-packages/pandas/core/apply.py", line 1081, in apply_series_generator
results[i] = self.func(v, *self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<stdin>", line 1, in foo
AttributeError: 'int' object has no attribute 'item'
```
### Issue Description
I ran into this issue where I have a series processing udf, which works fine if I pass a dataframe row to it, but breaks when I `dataframe.apply` it with `axis=1`. It seems the numpy value in the index is being lost in the latter.
### Expected Behavior
A user defined function should have the same behavior, whether a dataframe row is passed to it directly or via `DataFrame.apply`.
### Installed Versions
<details>
commit : 0691c5cf90477d3503834d983f69350f250a6ff7
python : 3.12.0b4
python-bits : 64
OS : Linux
OS-release : 6.9.10-1rodete4-amd64
Version : #1 SMP PREEMPT_DYNAMIC Debian 6.9.10-1rodete4 (2024-08-02)
machine : x86_64
processor :
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 2.2.3
numpy : 2.1.1
pytz : 2024.2
dateutil : 2.9.0.post0
pip : 23.1.2
Cython : None
sphinx : None
IPython : 8.27.0
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : None
blosc : None
bottleneck : None
dataframe-api-compat : None
fastparquet : None
fsspec : 2024.9.0
html5lib : None
hypothesis : None
gcsfs : 2024.9.0post1
jinja2 : None
lxml.etree : None
matplotlib : 3.9.2
numba : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : 0.23.2
psycopg2 : None
pymysql : None
pyarrow : 17.0.0
pyreadstat : None
pytest : 8.3.3
python-calamine : None
pyxlsb : None
s3fs : None
scipy : 1.14.1
sqlalchemy : 2.0.35
tables : None
tabulate : 0.9.0
xarray : None
xlrd : None
xlsxwriter : None
zstandard : None
tzdata : 2024.2
qtpy : None
pyqt5 : None
</details>
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59908/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59908/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59904 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59904/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59904/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59904/events | https://github.com/pandas-dev/pandas/issues/59904 | 2,550,581,040 | I_kwDOAA0YD86YBscw | 59,904 | BUG: pd.read_csv date parsing not working with dtype_backend="pyarrow" and missing values | {
"login": "mhabets",
"id": 2016449,
"node_id": "MDQ6VXNlcjIwMTY0NDk=",
"avatar_url": "https://avatars.githubusercontent.com/u/2016449?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/mhabets",
"html_url": "https://github.com/mhabets",
"followers_url": "https://api.github.com/users/mhabets/followers",
"following_url": "https://api.github.com/users/mhabets/following{/other_user}",
"gists_url": "https://api.github.com/users/mhabets/gists{/gist_id}",
"starred_url": "https://api.github.com/users/mhabets/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mhabets/subscriptions",
"organizations_url": "https://api.github.com/users/mhabets/orgs",
"repos_url": "https://api.github.com/users/mhabets/repos",
"events_url": "https://api.github.com/users/mhabets/events{/privacy}",
"received_events_url": "https://api.github.com/users/mhabets/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 76811,
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug",
"name": "Bug",
"color": "e10c02",
"default": false,
"description": null
},
{
"id": 2822342,
"node_id": "MDU6TGFiZWwyODIyMzQy",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Missing-data",
"name": "Missing-data",
"color": "d7e102",
"default": false,
"description": "np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate"
},
{
"id": 47229171,
"node_id": "MDU6TGFiZWw0NzIyOTE3MQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/IO%20CSV",
"name": "IO CSV",
"color": "5319e7",
"default": false,
"description": "read_csv, to_csv"
},
{
"id": 717120670,
"node_id": "MDU6TGFiZWw3MTcxMjA2NzA=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/good%20first%20issue",
"name": "good first issue",
"color": "0e8a16",
"default": true,
"description": null
},
{
"id": 986278782,
"node_id": "MDU6TGFiZWw5ODYyNzg3ODI=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Needs%20Tests",
"name": "Needs Tests",
"color": "cdea3c",
"default": false,
"description": "Unit test(s) needed to prevent regressions"
},
{
"id": 3303158446,
"node_id": "MDU6TGFiZWwzMzAzMTU4NDQ2",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Arrow",
"name": "Arrow",
"color": "f9d0c4",
"default": false,
"description": "pyarrow functionality"
}
] | open | false | {
"login": "wshaoul",
"id": 82252983,
"node_id": "MDQ6VXNlcjgyMjUyOTgz",
"avatar_url": "https://avatars.githubusercontent.com/u/82252983?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/wshaoul",
"html_url": "https://github.com/wshaoul",
"followers_url": "https://api.github.com/users/wshaoul/followers",
"following_url": "https://api.github.com/users/wshaoul/following{/other_user}",
"gists_url": "https://api.github.com/users/wshaoul/gists{/gist_id}",
"starred_url": "https://api.github.com/users/wshaoul/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/wshaoul/subscriptions",
"organizations_url": "https://api.github.com/users/wshaoul/orgs",
"repos_url": "https://api.github.com/users/wshaoul/repos",
"events_url": "https://api.github.com/users/wshaoul/events{/privacy}",
"received_events_url": "https://api.github.com/users/wshaoul/received_events",
"type": "User",
"site_admin": false
} | [
{
"login": "wshaoul",
"id": 82252983,
"node_id": "MDQ6VXNlcjgyMjUyOTgz",
"avatar_url": "https://avatars.githubusercontent.com/u/82252983?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/wshaoul",
"html_url": "https://github.com/wshaoul",
"followers_url": "https://api.github.com/users/wshaoul/followers",
"following_url": "https://api.github.com/users/wshaoul/following{/other_user}",
"gists_url": "https://api.github.com/users/wshaoul/gists{/gist_id}",
"starred_url": "https://api.github.com/users/wshaoul/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/wshaoul/subscriptions",
"organizations_url": "https://api.github.com/users/wshaoul/orgs",
"repos_url": "https://api.github.com/users/wshaoul/repos",
"events_url": "https://api.github.com/users/wshaoul/events{/privacy}",
"received_events_url": "https://api.github.com/users/wshaoul/received_events",
"type": "User",
"site_admin": false
}
] | null | 4 | 2024-09-26T13:22:38 | 2024-10-04T15:33:08 | null | NONE | null | null | null | ### Pandas version checks
- [X] I have checked that this issue has not already been reported.
- [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas.
- [ ] I have confirmed this bug exists on the [main branch](https://pandas.pydata.org/docs/dev/getting_started/install.html#installing-the-development-version-of-pandas) of pandas.
### Reproducible Example
```python
import io
data = """date,id
20/12/2025,a
,b
31/12/2020,c
"""
df = pd.read_csv(io.StringIO(data), parse_dates=["date"], dayfirst=True, dtype_backend="pyarrow")
df.dtypes
# date string[pyarrow_numpy]
# id large_string[pyarrow]
```
### Issue Description
dtype for the date column is not a date dtype as a result of a date parsing failure because of the missing value on the second row
### Expected Behavior
dtype for the date column should be `timestamp[ns][pyarrow]`
### Installed Versions
<details>
INSTALLED VERSIONS
------------------
commit : d9cdd2ee5a58015ef6f4d15c7226110c9aab8140
python : 3.12.5.final.0
python-bits : 64
OS : Windows
OS-release : 11
Version : 10.0.22631
machine : AMD64
processor : Intel64 Family 6 Model 154 Stepping 3, GenuineIntel
byteorder : little
LC_ALL : None
LANG : en
LOCALE : English_United Kingdom.1252
pandas : 2.2.2
numpy : 2.0.1
pytz : 2024.1
dateutil : 2.9.0
setuptools : 72.1.0
pip : 24.2
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : 5.3.0
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 3.1.4
IPython : 8.26.0
pandas_datareader : None
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : 4.12.3
bottleneck : None
dataframe-api-compat : None
fastparquet : None
fsspec : None
gcsfs : None
matplotlib : 3.9.2
numba : None
numexpr : None
odfpy : None
openpyxl : 3.1.5
pandas_gbq : None
pyarrow : 17.0.0
pyreadstat : None
python-calamine : None
pyxlsb : None
s3fs : None
scipy : 1.14.0
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : 2.0.1
zstandard : 0.23.0
tzdata : 2024.1
qtpy : None
pyqt5 : None
</details>
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59904/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59904/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59902 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59902/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59902/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59902/events | https://github.com/pandas-dev/pandas/issues/59902 | 2,550,422,790 | I_kwDOAA0YD86YBF0G | 59,902 | docs: update `freq` description for `pd.Timedelta.ceil` to match `DatetimeIndex.ceil`'s `freq` description | {
"login": "robert-nash",
"id": 1884158,
"node_id": "MDQ6VXNlcjE4ODQxNTg=",
"avatar_url": "https://avatars.githubusercontent.com/u/1884158?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/robert-nash",
"html_url": "https://github.com/robert-nash",
"followers_url": "https://api.github.com/users/robert-nash/followers",
"following_url": "https://api.github.com/users/robert-nash/following{/other_user}",
"gists_url": "https://api.github.com/users/robert-nash/gists{/gist_id}",
"starred_url": "https://api.github.com/users/robert-nash/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/robert-nash/subscriptions",
"organizations_url": "https://api.github.com/users/robert-nash/orgs",
"repos_url": "https://api.github.com/users/robert-nash/repos",
"events_url": "https://api.github.com/users/robert-nash/events{/privacy}",
"received_events_url": "https://api.github.com/users/robert-nash/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 134699,
"node_id": "MDU6TGFiZWwxMzQ2OTk=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Docs",
"name": "Docs",
"color": "3465A4",
"default": false,
"description": null
},
{
"id": 49597148,
"node_id": "MDU6TGFiZWw0OTU5NzE0OA==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Timedelta",
"name": "Timedelta",
"color": "5319e7",
"default": false,
"description": "Timedelta data type"
},
{
"id": 717120670,
"node_id": "MDU6TGFiZWw3MTcxMjA2NzA=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/good%20first%20issue",
"name": "good first issue",
"color": "0e8a16",
"default": true,
"description": null
}
] | open | false | {
"login": "eightyseven",
"id": 164823963,
"node_id": "U_kgDOCdMDmw",
"avatar_url": "https://avatars.githubusercontent.com/u/164823963?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/eightyseven",
"html_url": "https://github.com/eightyseven",
"followers_url": "https://api.github.com/users/eightyseven/followers",
"following_url": "https://api.github.com/users/eightyseven/following{/other_user}",
"gists_url": "https://api.github.com/users/eightyseven/gists{/gist_id}",
"starred_url": "https://api.github.com/users/eightyseven/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/eightyseven/subscriptions",
"organizations_url": "https://api.github.com/users/eightyseven/orgs",
"repos_url": "https://api.github.com/users/eightyseven/repos",
"events_url": "https://api.github.com/users/eightyseven/events{/privacy}",
"received_events_url": "https://api.github.com/users/eightyseven/received_events",
"type": "User",
"site_admin": false
} | [
{
"login": "eightyseven",
"id": 164823963,
"node_id": "U_kgDOCdMDmw",
"avatar_url": "https://avatars.githubusercontent.com/u/164823963?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/eightyseven",
"html_url": "https://github.com/eightyseven",
"followers_url": "https://api.github.com/users/eightyseven/followers",
"following_url": "https://api.github.com/users/eightyseven/following{/other_user}",
"gists_url": "https://api.github.com/users/eightyseven/gists{/gist_id}",
"starred_url": "https://api.github.com/users/eightyseven/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/eightyseven/subscriptions",
"organizations_url": "https://api.github.com/users/eightyseven/orgs",
"repos_url": "https://api.github.com/users/eightyseven/repos",
"events_url": "https://api.github.com/users/eightyseven/events{/privacy}",
"received_events_url": "https://api.github.com/users/eightyseven/received_events",
"type": "User",
"site_admin": false
}
] | null | 11 | 2024-09-26T12:20:49 | 2024-10-05T16:00:16 | null | NONE | null | null | null | ### Pandas version checks
- [X] I have checked that this issue has not already been reported.
- [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas.
- [ ] I have confirmed this bug exists on the [main branch](https://pandas.pydata.org/docs/dev/getting_started/install.html#installing-the-development-version-of-pandas) of pandas.
### Reproducible Example
```python
import pandas as pd
td = pd.Timedelta('1001ms')
td.ceil("s")
td.ceil("min")
td.ceil("m")
```
### Issue Description
Calling td.ceil("m") causes the error:
```
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "timedeltas.pyx", line 2011, in pandas._libs.tslibs.timedeltas.Timedelta.ceil
File "timedeltas.pyx", line 1934, in pandas._libs.tslibs.timedeltas.Timedelta._round
File "timedeltas.pyx", line 2309, in pandas._libs.tslibs.timedeltas.get_unit_for_round
File "offsets.pyx", line 756, in pandas._libs.tslibs.offsets.BaseOffset.nanos.__get__
ValueError: <MonthEnd> is a non-fixed frequency
```
### Expected Behavior
td.ceil("m") should behave the same as td.ceil("min")
The documentation for [pandas.Timedelta.ceil](https://pandas.pydata.org/docs/reference/api/pandas.Timedelta.ceil.html#pandas.Timedelta.ceil) states that the freq parameter uses the same units as class constructor Timedelta.
The documentation for [pandas.Timedelta](https://pandas.pydata.org/docs/reference/api/pandas.Timedelta.html#pandas.Timedelta) lists (‘minutes’, ‘minute’, ‘min’, or ‘m’) as one of the possible value lines. This suggests to me that "min" and "m" are equivalent.
It seems that either the documentation could be clearer or there is a bug?
### Installed Versions
<details>
INSTALLED VERSIONS
------------------
commit : 0691c5cf90477d3503834d983f69350f250a6ff7
python : 3.12.4
python-bits : 64
OS : Windows
OS-release : 11
Version : 10.0.22631
machine : AMD64
processor : Intel64 Family 6 Model 154 Stepping 3, GenuineIntel
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : English_United Kingdom.1252
pandas : 2.2.3
numpy : 2.0.1
pytz : 2024.2
dateutil : 2.9.0.post0
pip : 24.1
Cython : None
sphinx : None
IPython : None
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : None
blosc : None
bottleneck : None
dataframe-api-compat : None
fastparquet : None
fsspec : None
html5lib : None
hypothesis : None
gcsfs : None
jinja2 : 3.1.4
lxml.etree : None
matplotlib : None
numba : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
psycopg2 : None
pymysql : None
pyarrow : None
pyreadstat : None
pytest : None
python-calamine : None
pyxlsb : None
s3fs : None
scipy : 1.14.0
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlsxwriter : None
zstandard : None
tzdata : 2024.2
qtpy : None
pyqt5 : None
</details>
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59902/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59902/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59900 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59900/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59900/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59900/events | https://github.com/pandas-dev/pandas/pull/59900 | 2,550,300,022 | PR_kwDOAA0YD858yASM | 59,900 | Improve error mesage verbosity | {
"login": "KevsterAmp",
"id": 109636487,
"node_id": "U_kgDOBojrhw",
"avatar_url": "https://avatars.githubusercontent.com/u/109636487?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/KevsterAmp",
"html_url": "https://github.com/KevsterAmp",
"followers_url": "https://api.github.com/users/KevsterAmp/followers",
"following_url": "https://api.github.com/users/KevsterAmp/following{/other_user}",
"gists_url": "https://api.github.com/users/KevsterAmp/gists{/gist_id}",
"starred_url": "https://api.github.com/users/KevsterAmp/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/KevsterAmp/subscriptions",
"organizations_url": "https://api.github.com/users/KevsterAmp/orgs",
"repos_url": "https://api.github.com/users/KevsterAmp/repos",
"events_url": "https://api.github.com/users/KevsterAmp/events{/privacy}",
"received_events_url": "https://api.github.com/users/KevsterAmp/received_events",
"type": "User",
"site_admin": false
} | [] | open | false | null | [] | null | 0 | 2024-09-26T11:25:58 | 2024-09-26T11:25:58 | null | CONTRIBUTOR | null | false | {
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/59900",
"html_url": "https://github.com/pandas-dev/pandas/pull/59900",
"diff_url": "https://github.com/pandas-dev/pandas/pull/59900.diff",
"patch_url": "https://github.com/pandas-dev/pandas/pull/59900.patch",
"merged_at": null
} | - [x] closes #59659 (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
- [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.
Continued stale PR: #59649 | null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59900/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59900/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59899 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59899/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59899/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59899/events | https://github.com/pandas-dev/pandas/issues/59899 | 2,549,707,635 | I_kwDOAA0YD86X-XNz | 59,899 | API: `astype` method fails to raise errors for `category` data type | {
"login": "noahblakesmith",
"id": 112357858,
"node_id": "U_kgDOBrJx4g",
"avatar_url": "https://avatars.githubusercontent.com/u/112357858?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/noahblakesmith",
"html_url": "https://github.com/noahblakesmith",
"followers_url": "https://api.github.com/users/noahblakesmith/followers",
"following_url": "https://api.github.com/users/noahblakesmith/following{/other_user}",
"gists_url": "https://api.github.com/users/noahblakesmith/gists{/gist_id}",
"starred_url": "https://api.github.com/users/noahblakesmith/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/noahblakesmith/subscriptions",
"organizations_url": "https://api.github.com/users/noahblakesmith/orgs",
"repos_url": "https://api.github.com/users/noahblakesmith/repos",
"events_url": "https://api.github.com/users/noahblakesmith/events{/privacy}",
"received_events_url": "https://api.github.com/users/noahblakesmith/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 35818298,
"node_id": "MDU6TGFiZWwzNTgxODI5OA==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/API%20Design",
"name": "API Design",
"color": "AD7FA8",
"default": false,
"description": null
},
{
"id": 78527356,
"node_id": "MDU6TGFiZWw3ODUyNzM1Ng==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Categorical",
"name": "Categorical",
"color": "e11d21",
"default": false,
"description": "Categorical Data Type"
}
] | open | false | null | [] | null | 4 | 2024-09-26T07:08:22 | 2024-09-29T12:03:55 | null | NONE | null | null | null | ### Pandas version checks
- [X] I have checked that this issue has not already been reported.
- [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas.
- [X] I have confirmed this bug exists on the [main branch](https://pandas.pydata.org/docs/dev/getting_started/install.html#installing-the-development-version-of-pandas) of pandas.
### Reproducible Example
```python
import pandas as pd
col = pd.Series(["a", "b", "c"], dtype=str)
cat = pd.api.types.CategoricalDtype(categories=["a", "b"])
col = col.astype(dtype=cat, errors="raise")
print(col)
0 a
1 b
2 NaN
dtype: category
Categories (2, object): ['a', 'b']
```
### Issue Description
No error is raised when recasting as a `category`, despite the presence of an undefined value, `c`. Rather, `c` is coerced to `NaN`.
This behavior appears inconsistent with that of other data types, such as `int`.
### Expected Behavior
I believe an error should be raised.
### Installed Versions
<details>
INSTALLED VERSIONS
------------------
commit : d9cdd2ee5a58015ef6f4d15c7226110c9aab8140
python : 3.10.14.final.0
python-bits : 64
OS : Darwin
OS-release : 23.6.0
Version : Darwin Kernel Version 23.6.0: Mon Jul 29 21:14:30 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T6000
machine : arm64
processor : arm
byteorder : little
LC_ALL : None
LANG : None
LOCALE : None.UTF-8
pandas : 2.2.2
numpy : 2.0.1
pytz : 2024.2
dateutil : 2.9.0.post0
setuptools : 72.1.0
pip : 24.2
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 3.1.4
IPython : 8.26.0
pandas_datareader : None
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : None
bottleneck : None
dataframe-api-compat : None
fastparquet : None
fsspec : 2024.9.0
gcsfs : None
matplotlib : None
numba : None
numexpr : None
odfpy : None
openpyxl : 3.1.4
pandas_gbq : None
pyarrow : 17.0.0
pyreadstat : None
python-calamine : None
pyxlsb : None
s3fs : None
scipy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : 2.0.1
zstandard : None
tzdata : 2024.1
qtpy : None
pyqt5 : None
</details>
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59899/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59899/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59897 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59897/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59897/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59897/events | https://github.com/pandas-dev/pandas/issues/59897 | 2,549,539,332 | I_kwDOAA0YD86X9uIE | 59,897 | ENH: Describe : add shortest, longest, avg/max/min length | {
"login": "simonaubertbd",
"id": 46959192,
"node_id": "MDQ6VXNlcjQ2OTU5MTky",
"avatar_url": "https://avatars.githubusercontent.com/u/46959192?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/simonaubertbd",
"html_url": "https://github.com/simonaubertbd",
"followers_url": "https://api.github.com/users/simonaubertbd/followers",
"following_url": "https://api.github.com/users/simonaubertbd/following{/other_user}",
"gists_url": "https://api.github.com/users/simonaubertbd/gists{/gist_id}",
"starred_url": "https://api.github.com/users/simonaubertbd/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/simonaubertbd/subscriptions",
"organizations_url": "https://api.github.com/users/simonaubertbd/orgs",
"repos_url": "https://api.github.com/users/simonaubertbd/repos",
"events_url": "https://api.github.com/users/simonaubertbd/events{/privacy}",
"received_events_url": "https://api.github.com/users/simonaubertbd/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 76812,
"node_id": "MDU6TGFiZWw3NjgxMg==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Enhancement",
"name": "Enhancement",
"color": "4E9A06",
"default": false,
"description": null
},
{
"id": 57522093,
"node_id": "MDU6TGFiZWw1NzUyMjA5Mw==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Strings",
"name": "Strings",
"color": "5319e7",
"default": false,
"description": "String extension data type and string data"
},
{
"id": 219960758,
"node_id": "MDU6TGFiZWwyMTk5NjA3NTg=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Needs%20Discussion",
"name": "Needs Discussion",
"color": "207de5",
"default": false,
"description": "Requires discussion from core team before further action"
}
] | open | false | null | [] | null | 4 | 2024-09-26T05:17:29 | 2024-10-01T04:56:26 | null | NONE | null | null | null | ### Feature Type
- [X] Adding new functionality to pandas
- [ ] Changing existing functionality in pandas
- [ ] Removing existing functionality in pandas
### Problem Description
Hello,
As of now, Describe is mainly oriented for numerical analysis. It's less useful when you have text, string values.
### Feature Description
Adding five statistics dedicated to string analysis for each concerned column:
-avg length
-max length
-min length
-shortest : one of the string with the minimum length
-longest : one of the string with the maximum length
### Alternative Solutions
writing something like that but that means more work to do (sorry for the formatting)
import pandas as pd
# Sample DataFrame for illustration
data = {
'name': ['Alice', 'Bob', 'Charlie', 'David'],
'city': ['New York', 'Los Angeles', 'San Francisco', 'Chicago'],
'country': ['USA', 'USA', 'USA', 'USA']
}
df = pd.DataFrame(data)
# Function to get string statistics
def string_column_statistics(df):
stats = {}
for col in df.select_dtypes(include='object').columns:
string_lengths = df[col].str.len()
avg_length = string_lengths.mean()
max_length = string_lengths.max()
min_length = string_lengths.min()
max_length_string = df[col][string_lengths.idxmax()]
min_length_string = df[col][string_lengths.idxmin()]
stats[col] = {
'average_length': avg_length,
'max_length': max_length,
'min_length': min_length,
'example_max_length': max_length_string,
'example_min_length': min_length_string
}
return pd.DataFrame(stats)
# Call the function
string_stats_df = string_column_statistics(df)
print(string_stats_df)
### Additional Context
Best regards,
Simon | null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59897/reactions",
"total_count": 1,
"+1": 1,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59897/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59895 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59895/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59895/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59895/events | https://github.com/pandas-dev/pandas/issues/59895 | 2,549,127,499 | I_kwDOAA0YD86X8JlL | 59,895 | REF: make _cast_pointwise_result an EA method | {
"login": "jbrockmendel",
"id": 8078968,
"node_id": "MDQ6VXNlcjgwNzg5Njg=",
"avatar_url": "https://avatars.githubusercontent.com/u/8078968?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/jbrockmendel",
"html_url": "https://github.com/jbrockmendel",
"followers_url": "https://api.github.com/users/jbrockmendel/followers",
"following_url": "https://api.github.com/users/jbrockmendel/following{/other_user}",
"gists_url": "https://api.github.com/users/jbrockmendel/gists{/gist_id}",
"starred_url": "https://api.github.com/users/jbrockmendel/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jbrockmendel/subscriptions",
"organizations_url": "https://api.github.com/users/jbrockmendel/orgs",
"repos_url": "https://api.github.com/users/jbrockmendel/repos",
"events_url": "https://api.github.com/users/jbrockmendel/events{/privacy}",
"received_events_url": "https://api.github.com/users/jbrockmendel/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 127681,
"node_id": "MDU6TGFiZWwxMjc2ODE=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Refactor",
"name": "Refactor",
"color": "FCE94F",
"default": false,
"description": "Internal refactoring of code"
},
{
"id": 849023693,
"node_id": "MDU6TGFiZWw4NDkwMjM2OTM=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/ExtensionArray",
"name": "ExtensionArray",
"color": "6138b5",
"default": false,
"description": "Extending pandas with custom dtypes or arrays."
}
] | open | false | null | [] | null | 1 | 2024-09-25T22:49:29 | 2024-09-28T12:04:01 | null | MEMBER | null | null | null | In the extension tests.extension.base.ops.BaseOpsUtil we have a _cast_pointwise_result method that is used to patch the result of Series.combine to do appropriate dtype inference so that we have e.g.
```
expected = series + other
middle = series.combine(other, operator.add)
result = self._cast_pointwise_result(middle)
tm.assert_series_equal(result, expected)
```
(There is also a test_combine_add method which does not currently use _cast_pointwise_result but could. Also test_combine_le looks like we implemented an entirely separate pattern for customizing dtype inference in that test. I'll look into seeing if these can re-use the _cast_pointwise_result pattern.)
This cast_pointwise_result should just be an EA method. ATM we override it in the arrow, masked, and string tests (I suspect that we _should_ be overriding it in the sparse tests but it looks like we skip a bunch of them instead).
This will effectively replace _from_scalars, which was a mis-feature. It will also let us de-kludge places where we use maybe_cast_pointwise_result and generally be more robust.
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59895/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59895/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59890 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59890/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59890/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59890/events | https://github.com/pandas-dev/pandas/issues/59890 | 2,548,070,666 | I_kwDOAA0YD86X4HkK | 59,890 | DOC: Should `DataFrame.drop()` accept a `set` for the `columns` , `index` and `labels` argument? | {
"login": "Dr-Irv",
"id": 15113894,
"node_id": "MDQ6VXNlcjE1MTEzODk0",
"avatar_url": "https://avatars.githubusercontent.com/u/15113894?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Dr-Irv",
"html_url": "https://github.com/Dr-Irv",
"followers_url": "https://api.github.com/users/Dr-Irv/followers",
"following_url": "https://api.github.com/users/Dr-Irv/following{/other_user}",
"gists_url": "https://api.github.com/users/Dr-Irv/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Dr-Irv/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Dr-Irv/subscriptions",
"organizations_url": "https://api.github.com/users/Dr-Irv/orgs",
"repos_url": "https://api.github.com/users/Dr-Irv/repos",
"events_url": "https://api.github.com/users/Dr-Irv/events{/privacy}",
"received_events_url": "https://api.github.com/users/Dr-Irv/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 134699,
"node_id": "MDU6TGFiZWwxMzQ2OTk=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Docs",
"name": "Docs",
"color": "3465A4",
"default": false,
"description": null
},
{
"id": 219960758,
"node_id": "MDU6TGFiZWwyMTk5NjA3NTg=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Needs%20Discussion",
"name": "Needs Discussion",
"color": "207de5",
"default": false,
"description": "Requires discussion from core team before further action"
}
] | open | false | null | [] | null | 3 | 2024-09-25T13:54:25 | 2024-10-01T16:17:52 | null | CONTRIBUTOR | null | null | null | ### Pandas version checks
- [X] I have checked that the issue still exists on the latest versions of the docs on `main` [here](https://pandas.pydata.org/docs/dev/)
### Location of the documentation
https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.drop.html
### Documentation problem
The arguments `labels`, `index` and `columns` are documented as "single label or list-like". But a set is accepted:
```python
import pandas as pd
df = pd.DataFrame({1: [2], 3: [4]}) # Fix is here
df = df.drop(columns={1})
```
The pandas source declaration in the typing declarations does not allow a set to be passed.
### Suggested fix for documentation
Unclear.
Either we update the docs to say a set is allowed (and update the internal types), OR we add a check to see if a set is passed and raise an exception.
First raised as a `pandas-stubs` issue in https://github.com/pandas-dev/pandas-stubs/issues/1008 | null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59890/reactions",
"total_count": 1,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 1
} | https://api.github.com/repos/pandas-dev/pandas/issues/59890/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59889 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59889/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59889/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59889/events | https://github.com/pandas-dev/pandas/pull/59889 | 2,547,927,660 | PR_kwDOAA0YD858p3zt | 59,889 | Fixed #59592 | {
"login": "jyotirjoshi",
"id": 106726482,
"node_id": "U_kgDOBlyEUg",
"avatar_url": "https://avatars.githubusercontent.com/u/106726482?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/jyotirjoshi",
"html_url": "https://github.com/jyotirjoshi",
"followers_url": "https://api.github.com/users/jyotirjoshi/followers",
"following_url": "https://api.github.com/users/jyotirjoshi/following{/other_user}",
"gists_url": "https://api.github.com/users/jyotirjoshi/gists{/gist_id}",
"starred_url": "https://api.github.com/users/jyotirjoshi/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jyotirjoshi/subscriptions",
"organizations_url": "https://api.github.com/users/jyotirjoshi/orgs",
"repos_url": "https://api.github.com/users/jyotirjoshi/repos",
"events_url": "https://api.github.com/users/jyotirjoshi/events{/privacy}",
"received_events_url": "https://api.github.com/users/jyotirjoshi/received_events",
"type": "User",
"site_admin": false
} | [] | open | false | null | [] | null | 0 | 2024-09-25T12:58:24 | 2024-09-25T13:04:06 | null | NONE | null | false | {
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/59889",
"html_url": "https://github.com/pandas-dev/pandas/pull/59889",
"diff_url": "https://github.com/pandas-dev/pandas/pull/59889.diff",
"patch_url": "https://github.com/pandas-dev/pandas/pull/59889.patch",
"merged_at": null
} | Don't know exactly .that does this work this the first time. I am contributing. Sorry for the mistake
- [ ] 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.
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59889/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59889/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59888 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59888/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59888/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59888/events | https://github.com/pandas-dev/pandas/issues/59888 | 2,547,746,132 | I_kwDOAA0YD86X24VU | 59,888 | BUG: select_dtypes does not work with timestamp[ns][pyarrow] | {
"login": "dbalabka",
"id": 1269372,
"node_id": "MDQ6VXNlcjEyNjkzNzI=",
"avatar_url": "https://avatars.githubusercontent.com/u/1269372?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/dbalabka",
"html_url": "https://github.com/dbalabka",
"followers_url": "https://api.github.com/users/dbalabka/followers",
"following_url": "https://api.github.com/users/dbalabka/following{/other_user}",
"gists_url": "https://api.github.com/users/dbalabka/gists{/gist_id}",
"starred_url": "https://api.github.com/users/dbalabka/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dbalabka/subscriptions",
"organizations_url": "https://api.github.com/users/dbalabka/orgs",
"repos_url": "https://api.github.com/users/dbalabka/repos",
"events_url": "https://api.github.com/users/dbalabka/events{/privacy}",
"received_events_url": "https://api.github.com/users/dbalabka/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 76811,
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug",
"name": "Bug",
"color": "e10c02",
"default": false,
"description": null
},
{
"id": 1954720290,
"node_id": "MDU6TGFiZWwxOTU0NzIwMjkw",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Needs%20Triage",
"name": "Needs Triage",
"color": "0052cc",
"default": false,
"description": "Issue that has not been reviewed by a pandas team member"
}
] | open | false | null | [] | null | 3 | 2024-09-25T11:38:26 | 2024-10-05T14:09:36 | null | NONE | null | null | null | ### Pandas version checks
- [X] I have checked that this issue has not already been reported.
- [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas.
- [ ] I have confirmed this bug exists on the [main branch](https://pandas.pydata.org/docs/dev/getting_started/install.html#installing-the-development-version-of-pandas) of pandas.
### Reproducible Example
```python
import pandas as pd
import pyarrow
# Create a sample DataFrame
data = {
'id': [1, 2, 3],
'date1': pd.to_datetime(['2023-01-01', '2023-01-02', '2023-01-03']),
'date2': pd.to_datetime(['2023-02-01', '2023-02-02', '2023-02-03']),
'value': [10, 20, 30]
}
df = pd.DataFrame(data)
# Convert datetime columns to 'timestamp[ns][pyarrow]'
df = df.astype({
'date1': 'timestamp[ns][pyarrow]',
'date2': 'timestamp[ns][pyarrow]',
'value': 'int64[pyarrow]'
})
print('\n\nAll types:\n' + str(df.dtypes))
print('\n\nIt works for other types `int64`:\n' + str(df.select_dtypes(include=['int64']).dtypes))
print('\n\nIt works for other types `pd.ArrowDtype(pa.int64())`:\n' + str(df.select_dtypes(include=[pd.ArrowDtype(pa.int64())]).dtypes))
print('\n\nBut it does not for `timestamp[ns][pyarrow]`:\n' + str(df.select_dtypes(include=['timestamp[ns][pyarrow]']).dtypes))
print('\n\nThe type should not interpreter as `datetime64[ns]`:\n' + str(df.select_dtypes(include=['datetime64[ns]']).dtypes))
print('\n\nHere is a proper workaround with `pd.ArrowDtype(pa.timestamp(ns))`:\n' + str(df.select_dtypes(include=[pd.ArrowDtype(pa.timestamp('ns'))]).dtypes))
```
```
All types:
id int64
date1 timestamp[ns][pyarrow]
date2 timestamp[ns][pyarrow]
value int64[pyarrow]
dtype: object
It works for other types `int64`:
id int64
value int64[pyarrow]
dtype: object
It works for other types `pd.ArrowDtype(pa.int64())`:
id int64
value int64[pyarrow]
dtype: object
But it does not for `timestamp[ns][pyarrow]`:
Series([], dtype: object)
The type should not interpreter as `datetime64[ns]`:
date1 timestamp[ns][pyarrow]
date2 timestamp[ns][pyarrow]
dtype: object
Here is a proper workaround with `pd.ArrowDtype(pa.timestamp(ns))`:
date1 timestamp[ns][pyarrow]
date2 timestamp[ns][pyarrow]
dtype: object
```
### Issue Description
For unknown reasons, `select_dtypes` can not select the `timestamp[ns][pyarrow]` type because of the incorrect string-representation to type object conversion. It does work when we use type object explicitly like: `pd.ArrowDtype(pa.timestamp('ns'))`
### Expected Behavior
`select_dtypes` should select columns with `timestamp[ns][pyarrow]` type when `timestamp[ns][pyarrow]` string provided.
`select_dtypes` should select columns with `timestamp[ns][pyarrow]` type when `pd.ArrowDtype(pa.timestamp(ns))` object provided.
`select_dtypes` should not select columns with `timestamp[ns][pyarrow]` when `datetime64[ns]` provided.
### Installed Versions
<details>
INSTALLED VERSIONS
------------------
commit : d9cdd2ee5a58015ef6f4d15c7226110c9aab8140
python : 3.10.12.final.0
python-bits : 64
OS : Linux
OS-release : 5.15.153.1-microsoft-standard-WSL2
Version : #1 SMP Fri Mar 29 23:14:13 UTC 2024
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : C.UTF-8
LOCALE : en_US.UTF-8
pandas : 2.2.2
numpy : 1.26.3
pytz : 2023.4
dateutil : 2.8.2
setuptools : 69.0.3
pip : 24.0
Cython : None
pytest : 7.4.4
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 3.1.3
IPython : 8.20.0
pandas_datareader : None
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : 4.12.3
bottleneck : None
dataframe-api-compat : None
fastparquet : None
fsspec : 2023.12.2
gcsfs : 2023.12.2post1
matplotlib : 3.8.2
numba : 0.58.1
numexpr : None
odfpy : None
openpyxl : 3.1.2
pandas_gbq : None
pyarrow : 14.0.2
pyreadstat : None
python-calamine : None
pyxlsb : None
s3fs : 2023.12.2
scipy : 1.12.0
sqlalchemy : 2.0.29
tables : None
tabulate : 0.9.0
xarray : None
xlrd : None
zstandard : None
tzdata : 2023.4
qtpy : None
pyqt5 : None
</details>
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59888/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59888/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59887 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59887/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59887/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59887/events | https://github.com/pandas-dev/pandas/issues/59887 | 2,547,712,511 | I_kwDOAA0YD86X2wH_ | 59,887 | BUG: drop_duplicates() inconsistent output when using/not using subset and having different types of NaNs | {
"login": "user-jx",
"id": 129590031,
"node_id": "U_kgDOB7ljDw",
"avatar_url": "https://avatars.githubusercontent.com/u/129590031?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/user-jx",
"html_url": "https://github.com/user-jx",
"followers_url": "https://api.github.com/users/user-jx/followers",
"following_url": "https://api.github.com/users/user-jx/following{/other_user}",
"gists_url": "https://api.github.com/users/user-jx/gists{/gist_id}",
"starred_url": "https://api.github.com/users/user-jx/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/user-jx/subscriptions",
"organizations_url": "https://api.github.com/users/user-jx/orgs",
"repos_url": "https://api.github.com/users/user-jx/repos",
"events_url": "https://api.github.com/users/user-jx/events{/privacy}",
"received_events_url": "https://api.github.com/users/user-jx/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 76811,
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug",
"name": "Bug",
"color": "e10c02",
"default": false,
"description": null
},
{
"id": 219960758,
"node_id": "MDU6TGFiZWwyMTk5NjA3NTg=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Needs%20Discussion",
"name": "Needs Discussion",
"color": "207de5",
"default": false,
"description": "Requires discussion from core team before further action"
},
{
"id": 6129961102,
"node_id": "LA_kwDOAA0YD88AAAABbV_Ijg",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/PDEP%20missing%20values",
"name": "PDEP missing values",
"color": "fbca04",
"default": false,
"description": "Issues that would be addressed by the Ice Cream Agreement from the Aug 2023 sprint"
}
] | open | false | null | [] | null | 5 | 2024-09-25T11:22:12 | 2024-10-05T13:32:26 | null | NONE | null | null | null | ### Pandas version checks
- [X] I have checked that this issue has not already been reported.
- [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas.
- [X] I have confirmed this bug exists on the [main branch](https://pandas.pydata.org/docs/dev/getting_started/install.html#installing-the-development-version-of-pandas) of pandas.
### Reproducible Example
```python
import pandas as pd
df = pd.DataFrame({
'A':[1,1,1],
'B':[2,2,2],
'C':[3,3,3],
'D':[pd.NaT, pd.NaT, pd.NaT]
})
df.loc[0,'D'] = 0; df.loc[0,'D'] = float('nan')
df.loc[2,'D'] = 0; df.loc[2,'D'] = float('nan')
#%%
df.drop_duplicates(keep=False)
#%%
df.drop_duplicates(subset='D', keep=False)
```
### Issue Description
Hi,
I have the following pandas DataFrame:
```python
import pandas as pd
df = pd.DataFrame({
'A':[1,1,1],
'B':[2,2,2],
'C':[3,3,3],
'D':[pd.NaT, pd.NaT, pd.NaT]
})
df.loc[0,'D'] = 0; df.loc[0,'D'] = float('nan')
df.loc[2,'D'] = 0; df.loc[2,'D'] = float('nan')
```
```python-console
A B C D
0 1 2 3 NaN
1 1 2 3 NaT
2 1 2 3 NaN
```
With
```python
df.drop_duplicates(keep=False)
```
I get:
```python-console
Empty DataFrame
Columns: [A, B, C, D]
Index: []
```
But when using the parameter `subset` for the only column that has a difference,
```python
df.drop_duplicates(subset='D', keep=False)
```
I get:
```python-console
A B C D
1 1 2 3 NaT
```
I have two questions:
1. Shouldn't the outcome be the same in both cases?
2. `pandas.NaT` and `float('nan')` are considered as different values by `drop_duplicates()`?
Thank you!
### Expected Behavior
I expected that the outcome would be the same in both cases.
### Installed Versions
<details>
INSTALLED VERSIONS
------------------
commit : a671b5a8bf5dd13fb19f0e88edc679bc9e15c673
python : 3.10.13.final.0
python-bits : 64
OS : Windows
OS-release : 10
Version : 10.0.19045
machine : AMD64
processor : Intel64 Family 6 Model 167 Stepping 1, GenuineIntel
byteorder : little
LC_ALL : None
LANG : en
LOCALE : English_United States.1253
pandas : 2.1.4
numpy : 1.25.2
pytz : 2023.3.post1
dateutil : 2.8.2
setuptools : 68.2.2
pip : 23.3.1
Cython : None
pytest : None
hypothesis : None
sphinx : 5.0.2
blosc : None
feather : None
xlsxwriter : 3.1.9
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 3.1.3
IPython : 8.20.0
pandas_datareader : None
bs4 : 4.12.2
bottleneck : 1.3.7
dataframe-api-compat: None
fastparquet : None
fsspec : 2024.3.1
gcsfs : None
matplotlib : 3.8.4
numba : 0.59.0
numexpr : 2.8.7
odfpy : None
openpyxl : 3.0.10
pandas_gbq : None
pyarrow : 14.0.2
pyreadstat : None
pyxlsb : None
s3fs : None
scipy : 1.9.3
sqlalchemy : None
tables : 3.9.2
tabulate : 0.9.0
xarray : 2024.2.0
xlrd : None
zstandard : None
tzdata : 2023.3
qtpy : 2.4.1
pyqt5 : None
</details>
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59887/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59887/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59884 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59884/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59884/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59884/events | https://github.com/pandas-dev/pandas/issues/59884 | 2,547,383,545 | I_kwDOAA0YD86X1fz5 | 59,884 | BUG: Disabling pandas option display.html.use_mathjax has no effect | {
"login": "niklassemmler",
"id": 1880943,
"node_id": "MDQ6VXNlcjE4ODA5NDM=",
"avatar_url": "https://avatars.githubusercontent.com/u/1880943?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/niklassemmler",
"html_url": "https://github.com/niklassemmler",
"followers_url": "https://api.github.com/users/niklassemmler/followers",
"following_url": "https://api.github.com/users/niklassemmler/following{/other_user}",
"gists_url": "https://api.github.com/users/niklassemmler/gists{/gist_id}",
"starred_url": "https://api.github.com/users/niklassemmler/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/niklassemmler/subscriptions",
"organizations_url": "https://api.github.com/users/niklassemmler/orgs",
"repos_url": "https://api.github.com/users/niklassemmler/repos",
"events_url": "https://api.github.com/users/niklassemmler/events{/privacy}",
"received_events_url": "https://api.github.com/users/niklassemmler/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 76811,
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug",
"name": "Bug",
"color": "e10c02",
"default": false,
"description": null
},
{
"id": 13101118,
"node_id": "MDU6TGFiZWwxMzEwMTExOA==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Output-Formatting",
"name": "Output-Formatting",
"color": "ededed",
"default": false,
"description": "__repr__ of pandas objects, to_string"
},
{
"id": 717120670,
"node_id": "MDU6TGFiZWw3MTcxMjA2NzA=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/good%20first%20issue",
"name": "good first issue",
"color": "0e8a16",
"default": true,
"description": null
}
] | open | false | {
"login": "vivrdprasanna",
"id": 59852610,
"node_id": "MDQ6VXNlcjU5ODUyNjEw",
"avatar_url": "https://avatars.githubusercontent.com/u/59852610?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/vivrdprasanna",
"html_url": "https://github.com/vivrdprasanna",
"followers_url": "https://api.github.com/users/vivrdprasanna/followers",
"following_url": "https://api.github.com/users/vivrdprasanna/following{/other_user}",
"gists_url": "https://api.github.com/users/vivrdprasanna/gists{/gist_id}",
"starred_url": "https://api.github.com/users/vivrdprasanna/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/vivrdprasanna/subscriptions",
"organizations_url": "https://api.github.com/users/vivrdprasanna/orgs",
"repos_url": "https://api.github.com/users/vivrdprasanna/repos",
"events_url": "https://api.github.com/users/vivrdprasanna/events{/privacy}",
"received_events_url": "https://api.github.com/users/vivrdprasanna/received_events",
"type": "User",
"site_admin": false
} | [
{
"login": "vivrdprasanna",
"id": 59852610,
"node_id": "MDQ6VXNlcjU5ODUyNjEw",
"avatar_url": "https://avatars.githubusercontent.com/u/59852610?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/vivrdprasanna",
"html_url": "https://github.com/vivrdprasanna",
"followers_url": "https://api.github.com/users/vivrdprasanna/followers",
"following_url": "https://api.github.com/users/vivrdprasanna/following{/other_user}",
"gists_url": "https://api.github.com/users/vivrdprasanna/gists{/gist_id}",
"starred_url": "https://api.github.com/users/vivrdprasanna/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/vivrdprasanna/subscriptions",
"organizations_url": "https://api.github.com/users/vivrdprasanna/orgs",
"repos_url": "https://api.github.com/users/vivrdprasanna/repos",
"events_url": "https://api.github.com/users/vivrdprasanna/events{/privacy}",
"received_events_url": "https://api.github.com/users/vivrdprasanna/received_events",
"type": "User",
"site_admin": false
},
{
"login": "Asifussain",
"id": 93661420,
"node_id": "U_kgDOBZUo7A",
"avatar_url": "https://avatars.githubusercontent.com/u/93661420?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Asifussain",
"html_url": "https://github.com/Asifussain",
"followers_url": "https://api.github.com/users/Asifussain/followers",
"following_url": "https://api.github.com/users/Asifussain/following{/other_user}",
"gists_url": "https://api.github.com/users/Asifussain/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Asifussain/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Asifussain/subscriptions",
"organizations_url": "https://api.github.com/users/Asifussain/orgs",
"repos_url": "https://api.github.com/users/Asifussain/repos",
"events_url": "https://api.github.com/users/Asifussain/events{/privacy}",
"received_events_url": "https://api.github.com/users/Asifussain/received_events",
"type": "User",
"site_admin": false
},
{
"login": "JustinCapili",
"id": 107870885,
"node_id": "U_kgDOBm36pQ",
"avatar_url": "https://avatars.githubusercontent.com/u/107870885?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/JustinCapili",
"html_url": "https://github.com/JustinCapili",
"followers_url": "https://api.github.com/users/JustinCapili/followers",
"following_url": "https://api.github.com/users/JustinCapili/following{/other_user}",
"gists_url": "https://api.github.com/users/JustinCapili/gists{/gist_id}",
"starred_url": "https://api.github.com/users/JustinCapili/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/JustinCapili/subscriptions",
"organizations_url": "https://api.github.com/users/JustinCapili/orgs",
"repos_url": "https://api.github.com/users/JustinCapili/repos",
"events_url": "https://api.github.com/users/JustinCapili/events{/privacy}",
"received_events_url": "https://api.github.com/users/JustinCapili/received_events",
"type": "User",
"site_admin": false
}
] | null | 4 | 2024-09-25T08:53:52 | 2024-10-08T15:44:30 | null | NONE | null | null | null | ### Pandas version checks
- [X] I have checked that this issue has not already been reported.
- [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas.
- [ ] I have confirmed this bug exists on the [main branch](https://pandas.pydata.org/docs/dev/getting_started/install.html#installing-the-development-version-of-pandas) of pandas.
### Reproducible Example
```python
import pandas as pd
pd.set_option('display.html.use_mathjax', False)
pd.DataFrame([
"$2.13 dont_make_this_math $5.24"
])
```
### Issue Description
My pandas data frames contain text columns which contain dollar signs. I need to be represented as raw strings not as a math-formatted picture.
Pandas provides the option `display.html.use_mathjax` to this end. However, setting the option does not change pandas behavior. Even with the config set the string "$2.13 dont_make_this_math $5.24" has its spaces removed and text after `_` subscripted.
I understand this can be managed by explicitly escaping dollar signs in any text column I come across, but this is a lot of overhead.
### Expected Behavior

not as

### Installed Versions
<details>
INSTALLED VERSIONS
------------------
commit : 0691c5cf90477d3503834d983f69350f250a6ff7
python : 3.11.9
python-bits : 64
OS : Darwin
OS-release : 23.6.0
Version : Darwin Kernel Version 23.6.0: Mon Jul 29 21:14:30 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T6000
machine : arm64
processor : arm
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 2.2.3
numpy : 1.26.4
pytz : 2024.1
dateutil : 2.9.0.post0
pip : 23.3.1
Cython : None
sphinx : None
IPython : 8.27.0
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : 4.12.3
blosc : None
bottleneck : None
dataframe-api-compat : None
fastparquet : None
fsspec : None
html5lib : None
hypothesis : None
gcsfs : None
jinja2 : 3.1.4
lxml.etree : None
matplotlib : 3.9.2
numba : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
psycopg2 : None
pymysql : None
pyarrow : 15.0.2
pyreadstat : None
pytest : None
python-calamine : None
pyxlsb : None
s3fs : None
scipy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlsxwriter : None
zstandard : None
tzdata : 2024.1
qtpy : None
pyqt5 : None
</details>
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59884/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59884/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59883 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59883/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59883/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59883/events | https://github.com/pandas-dev/pandas/issues/59883 | 2,546,453,028 | I_kwDOAA0YD86Xx8ok | 59,883 | BUG: Arrow Binary View Types Don't Print When containing missing values | {
"login": "WillAyd",
"id": 609873,
"node_id": "MDQ6VXNlcjYwOTg3Mw==",
"avatar_url": "https://avatars.githubusercontent.com/u/609873?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/WillAyd",
"html_url": "https://github.com/WillAyd",
"followers_url": "https://api.github.com/users/WillAyd/followers",
"following_url": "https://api.github.com/users/WillAyd/following{/other_user}",
"gists_url": "https://api.github.com/users/WillAyd/gists{/gist_id}",
"starred_url": "https://api.github.com/users/WillAyd/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/WillAyd/subscriptions",
"organizations_url": "https://api.github.com/users/WillAyd/orgs",
"repos_url": "https://api.github.com/users/WillAyd/repos",
"events_url": "https://api.github.com/users/WillAyd/events{/privacy}",
"received_events_url": "https://api.github.com/users/WillAyd/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 76811,
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug",
"name": "Bug",
"color": "e10c02",
"default": false,
"description": null
},
{
"id": 57522093,
"node_id": "MDU6TGFiZWw1NzUyMjA5Mw==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Strings",
"name": "Strings",
"color": "5319e7",
"default": false,
"description": "String extension data type and string data"
},
{
"id": 219960758,
"node_id": "MDU6TGFiZWwyMTk5NjA3NTg=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Needs%20Discussion",
"name": "Needs Discussion",
"color": "207de5",
"default": false,
"description": "Requires discussion from core team before further action"
},
{
"id": 3303158446,
"node_id": "MDU6TGFiZWwzMzAzMTU4NDQ2",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Arrow",
"name": "Arrow",
"color": "f9d0c4",
"default": false,
"description": "pyarrow functionality"
}
] | open | false | null | [] | null | 4 | 2024-09-24T21:47:50 | 2024-09-30T22:56:20 | null | MEMBER | null | null | null | ### Pandas version checks
- [X] I have checked that this issue has not already been reported.
- [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas.
- [X] I have confirmed this bug exists on the [main branch](https://pandas.pydata.org/docs/dev/getting_started/install.html#installing-the-development-version-of-pandas) of pandas.
### Reproducible Example
```python
Note that this example produces output:
In [10]: import pandas as pd
...: import pyarrow as pa
...:
...: ser = pd.Series(["foo", "longer_than_binary_prefix", ''], dtype=pd.ArrowDtype(pa.string_view()))
In [11]: ser
Out[11]:
0 foo
1 longer_than_binary_prefix
2
dtype: string_view[pyarrow]
```
While this does not:
```
In [12]: import pandas as pd
...: import pyarrow as pa
...:
...: ser = pd.Series(["foo", "longer_than_binary_prefix", None], dtype=pd.ArrowDtype(pa.string_view()))
In [13]: ser
Out[13]:
```
This might actually be an upstream bug with pyarrow (@jorisvandenbossche typically knows best)
```
### Issue Description
Values are not printing
### Expected Behavior
Values should print
### Installed Versions
In [14]: pa.__version__
Out[14]: '17.0.0'
In [15]: pd.__version__
Out[15]: '2.2.3+44.g3dfa33cf2d'
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59883/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59883/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59882 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59882/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59882/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59882/events | https://github.com/pandas-dev/pandas/issues/59882 | 2,545,722,958 | I_kwDOAA0YD86XvKZO | 59,882 | BUG: When using to_excel() columns with Date Format are converting in Excel to 'General Format. | {
"login": "ArunPesari2",
"id": 43901309,
"node_id": "MDQ6VXNlcjQzOTAxMzA5",
"avatar_url": "https://avatars.githubusercontent.com/u/43901309?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ArunPesari2",
"html_url": "https://github.com/ArunPesari2",
"followers_url": "https://api.github.com/users/ArunPesari2/followers",
"following_url": "https://api.github.com/users/ArunPesari2/following{/other_user}",
"gists_url": "https://api.github.com/users/ArunPesari2/gists{/gist_id}",
"starred_url": "https://api.github.com/users/ArunPesari2/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ArunPesari2/subscriptions",
"organizations_url": "https://api.github.com/users/ArunPesari2/orgs",
"repos_url": "https://api.github.com/users/ArunPesari2/repos",
"events_url": "https://api.github.com/users/ArunPesari2/events{/privacy}",
"received_events_url": "https://api.github.com/users/ArunPesari2/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 76811,
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug",
"name": "Bug",
"color": "e10c02",
"default": false,
"description": null
},
{
"id": 49254273,
"node_id": "MDU6TGFiZWw0OTI1NDI3Mw==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/IO%20Excel",
"name": "IO Excel",
"color": "bfe5bf",
"default": false,
"description": "read_excel, to_excel"
},
{
"id": 307649777,
"node_id": "MDU6TGFiZWwzMDc2NDk3Nzc=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Needs%20Info",
"name": "Needs Info",
"color": "207de5",
"default": false,
"description": "Clarification about behavior needed to assess issue"
}
] | open | false | null | [] | null | 2 | 2024-09-24T15:25:21 | 2024-10-08T04:35:00 | null | NONE | null | null | null | ### Pandas version checks
- [X] I have checked that this issue has not already been reported.
- [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas.
- [X] I have confirmed this bug exists on the [main branch](https://pandas.pydata.org/docs/dev/getting_started/install.html#installing-the-development-version-of-pandas) of pandas.
### Reproducible Example
```python
import pandas as pd
from openpyxl import load_workbook
from openpyxl.styles import NamedStyle
# Create a sample DataFrame with dates in 'mm-dd-yyyy' format
data = {
"date": ["12-31-2023", "01-01-2024", "05-23-2024"]
}
df = pd.DataFrame(data)
# Convert the 'date' column from 'mm-dd-yyyy' to datetime format
df['date'] = pd.to_datetime(df['date'], format='%m-%d-%Y')
# Convert the datetime objects back to strings in 'dd-mm-yyyy' format
df['date'] = df['date'].dt.strftime('%d-%m-%Y')
df['date'] = pd.to_datetime(df['date'], format='%d-%m-%Y')
# Save the DataFrame to an Excel file using openpyxl as the engine
df.to_excel('formatted_dates_pandas.xlsx', index=False, engine='openpyxl')
# Load the Excel file with openpyxl
workbook = load_workbook('formatted_dates_pandas.xlsx')
worksheet = workbook.active
# Define a date format style for 'DD-MM-YYYY'
date_style = NamedStyle(name='date_style', number_format='DD-MM-YYYY')
for row in range(2, len(df) + 2): # Skip header row, start from row 2
worksheet.cell(row=row, column=1).value = df['date'].iloc[row - 2] # Write the string directly
# Save the workbook
workbook.save('formatted_dates_pandas.xlsx')
```
### Issue Description
i have a date column in pandas, when i write to an excel , i am loosing the format in excel.
In excel it is seen as General Format. If this a bug, pls fix it or revert back with an approach.
### Expected Behavior
In Excel we should not loose format of date (dd-mm-YYYY).
### Installed Versions
INSTALLED VERSIONS
------------------
commit : 0691c5cf90477d3503834d983f69350f250a6ff7
python : 3.11.4
python-bits : 64
OS : Windows
OS-release : 10
Version : 10.0.22621
machine : AMD64
processor : Intel64 Family 6 Model 154 Stepping 3, GenuineIntel
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : English_India.1252
pandas : 2.2.3
numpy : 2.1.1
pytz : 2024.2
dateutil : 2.9.0.post0
pip : 23.1.2
Cython : None
sphinx : None
IPython : None
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : None
blosc : None
bottleneck : None
dataframe-api-compat : None
fastparquet : None
fsspec : None
html5lib : None
hypothesis : None
gcsfs : None
jinja2 : None
lxml.etree : None
matplotlib : None
numba : None
numexpr : None
odfpy : None
openpyxl : 3.1.5
pandas_gbq : None
psycopg2 : None
pymysql : None
pyarrow : 17.0.0
pyreadstat : None
pytest : None
python-calamine : None
pyxlsb : None
s3fs : None
scipy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlsxwriter : 3.2.0
zstandard : None
tzdata : 2024.2
qtpy : None
pyqt5 : None | null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59882/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59882/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59880 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59880/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59880/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59880/events | https://github.com/pandas-dev/pandas/issues/59880 | 2,543,824,516 | I_kwDOAA0YD86Xn66E | 59,880 | DOC: defaults in method signature vs description | {
"login": "kuraga",
"id": 1063219,
"node_id": "MDQ6VXNlcjEwNjMyMTk=",
"avatar_url": "https://avatars.githubusercontent.com/u/1063219?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/kuraga",
"html_url": "https://github.com/kuraga",
"followers_url": "https://api.github.com/users/kuraga/followers",
"following_url": "https://api.github.com/users/kuraga/following{/other_user}",
"gists_url": "https://api.github.com/users/kuraga/gists{/gist_id}",
"starred_url": "https://api.github.com/users/kuraga/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kuraga/subscriptions",
"organizations_url": "https://api.github.com/users/kuraga/orgs",
"repos_url": "https://api.github.com/users/kuraga/repos",
"events_url": "https://api.github.com/users/kuraga/events{/privacy}",
"received_events_url": "https://api.github.com/users/kuraga/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 134699,
"node_id": "MDU6TGFiZWwxMzQ2OTk=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Docs",
"name": "Docs",
"color": "3465A4",
"default": false,
"description": null
},
{
"id": 219960758,
"node_id": "MDU6TGFiZWwyMTk5NjA3NTg=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Needs%20Discussion",
"name": "Needs Discussion",
"color": "207de5",
"default": false,
"description": "Requires discussion from core team before further action"
}
] | open | false | null | [] | null | 7 | 2024-09-23T22:32:05 | 2024-09-27T19:17:38 | null | NONE | null | null | null | ### Pandas version checks
- [X] I have checked that the issue still exists on the latest versions of the docs on `main` [here](https://pandas.pydata.org/docs/dev/)
### Location of the documentation
Everywhere.
### Documentation problem
The default value in method signature and the default value in the method description _is sometimes different_.
Examples:
https://pandas.pydata.org/docs/reference/api/pandas.Series.replace.html:
does `Series.replace`'s:
`to_replace` have `None` (docs signature) as default, or have no default (docs description)?
`value` have no default (docs signature), or `None` (docs description)?
https://pandas.pydata.org/docs/reference/api/pandas.read_csv.html:
does `read_csv`'s:
`sep` have no default (docs signature), or `';'` (docs description)?
...
...
### Suggested fix for documentation
Fix. | null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59880/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59880/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59879 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59879/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59879/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59879/events | https://github.com/pandas-dev/pandas/issues/59879 | 2,543,054,802 | I_kwDOAA0YD86Xk-_S | 59,879 | BUG (string dtype): looking up missing value in the Index fails | {
"login": "jorisvandenbossche",
"id": 1020496,
"node_id": "MDQ6VXNlcjEwMjA0OTY=",
"avatar_url": "https://avatars.githubusercontent.com/u/1020496?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/jorisvandenbossche",
"html_url": "https://github.com/jorisvandenbossche",
"followers_url": "https://api.github.com/users/jorisvandenbossche/followers",
"following_url": "https://api.github.com/users/jorisvandenbossche/following{/other_user}",
"gists_url": "https://api.github.com/users/jorisvandenbossche/gists{/gist_id}",
"starred_url": "https://api.github.com/users/jorisvandenbossche/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jorisvandenbossche/subscriptions",
"organizations_url": "https://api.github.com/users/jorisvandenbossche/orgs",
"repos_url": "https://api.github.com/users/jorisvandenbossche/repos",
"events_url": "https://api.github.com/users/jorisvandenbossche/events{/privacy}",
"received_events_url": "https://api.github.com/users/jorisvandenbossche/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 76811,
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug",
"name": "Bug",
"color": "e10c02",
"default": false,
"description": null
},
{
"id": 57522093,
"node_id": "MDU6TGFiZWw1NzUyMjA5Mw==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Strings",
"name": "Strings",
"color": "5319e7",
"default": false,
"description": "String extension data type and string data"
},
{
"id": 1218227310,
"node_id": "MDU6TGFiZWwxMjE4MjI3MzEw",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Index",
"name": "Index",
"color": "e99695",
"default": false,
"description": "Related to the Index class or subclasses"
}
] | open | false | null | [] | {
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/119",
"html_url": "https://github.com/pandas-dev/pandas/milestone/119",
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/119/labels",
"id": 11466880,
"node_id": "MI_kwDOAA0YD84ArviA",
"number": 119,
"title": "2.3",
"description": "on-merge: backport to 2.3.x",
"creator": {
"login": "jorisvandenbossche",
"id": 1020496,
"node_id": "MDQ6VXNlcjEwMjA0OTY=",
"avatar_url": "https://avatars.githubusercontent.com/u/1020496?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/jorisvandenbossche",
"html_url": "https://github.com/jorisvandenbossche",
"followers_url": "https://api.github.com/users/jorisvandenbossche/followers",
"following_url": "https://api.github.com/users/jorisvandenbossche/following{/other_user}",
"gists_url": "https://api.github.com/users/jorisvandenbossche/gists{/gist_id}",
"starred_url": "https://api.github.com/users/jorisvandenbossche/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jorisvandenbossche/subscriptions",
"organizations_url": "https://api.github.com/users/jorisvandenbossche/orgs",
"repos_url": "https://api.github.com/users/jorisvandenbossche/repos",
"events_url": "https://api.github.com/users/jorisvandenbossche/events{/privacy}",
"received_events_url": "https://api.github.com/users/jorisvandenbossche/received_events",
"type": "User",
"site_admin": false
},
"open_issues": 37,
"closed_issues": 70,
"state": "open",
"created_at": "2024-08-20T19:39:44",
"updated_at": "2024-10-03T20:12:23",
"due_on": null,
"closed_at": null
} | 0 | 2024-09-23T15:49:30 | 2024-09-23T15:49:41 | null | MEMBER | null | null | null | https://github.com/pandas-dev/pandas/issues/59765 is the general issue about consistency in index lookups for missing values, but shorter term, we at least need to fix being able to lookup missing values for the future string dtype.
With object dtype, this works fine:
```python
>>> idx = pd.Index(["a", "b", None])
>>> idx.get_loc(None)
2
```
But when enabling the string dtype, neither None or np.nan work as key:
```python
>>> pd.options.future.infer_string = True
>>> idx = pd.Index(["a", "b", None])
>>> idx.get_loc(None)
...
KeyError: None
>>> idx.get_loc(np.nan)
...
KeyError: nan
``` | null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59879/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59879/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59878 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59878/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59878/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59878/events | https://github.com/pandas-dev/pandas/pull/59878 | 2,543,042,800 | PR_kwDOAA0YD858ZD-O | 59,878 | DOC: Refactor _create_delegator_method using functools | {
"login": "saldanhad",
"id": 115748404,
"node_id": "U_kgDOBuYuNA",
"avatar_url": "https://avatars.githubusercontent.com/u/115748404?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/saldanhad",
"html_url": "https://github.com/saldanhad",
"followers_url": "https://api.github.com/users/saldanhad/followers",
"following_url": "https://api.github.com/users/saldanhad/following{/other_user}",
"gists_url": "https://api.github.com/users/saldanhad/gists{/gist_id}",
"starred_url": "https://api.github.com/users/saldanhad/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/saldanhad/subscriptions",
"organizations_url": "https://api.github.com/users/saldanhad/orgs",
"repos_url": "https://api.github.com/users/saldanhad/repos",
"events_url": "https://api.github.com/users/saldanhad/events{/privacy}",
"received_events_url": "https://api.github.com/users/saldanhad/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 134699,
"node_id": "MDU6TGFiZWwxMzQ2OTk=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Docs",
"name": "Docs",
"color": "3465A4",
"default": false,
"description": null
},
{
"id": 5783272581,
"node_id": "LA_kwDOAA0YD88AAAABWLW8hQ",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Accessors",
"name": "Accessors",
"color": "d93f0b",
"default": false,
"description": "accessor registration mechanism (not .str, .dt, .cat)"
}
] | open | false | null | [] | null | 5 | 2024-09-23T15:44:03 | 2024-10-08T06:01:07 | null | CONTRIBUTOR | null | false | {
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/59878",
"html_url": "https://github.com/pandas-dev/pandas/pull/59878",
"diff_url": "https://github.com/pandas-dev/pandas/pull/59878.diff",
"patch_url": "https://github.com/pandas-dev/pandas/pull/59878.patch",
"merged_at": null
} | * Refactoring `_create_delegator_method` using `functools`, partially fixes the docstrings for below under #59592 and fixes #59783 :
```
-i "pandas.Series.cat.add_categories PR01,PR02" \
-i "pandas.Series.cat.as_ordered PR01" \
-i "pandas.Series.cat.as_unordered PR01" \
-i "pandas.Series.cat.remove_categories PR01,PR02" \
-i "pandas.Series.cat.remove_unused_categories PR01" \
-i "pandas.Series.cat.rename_categories PR01,PR02" \
-i "pandas.Series.cat.reorder_categories PR01,PR02" \
-i "pandas.Series.cat.set_categories PR01,PR02" \
```
```
-i "pandas.Series.dt.to_period PR01,PR02" \
-i "pandas.Series.dt.as_unit PR01,PR02" \
-i "pandas.Series.dt.ceil PR01,PR02" \
-i "pandas.Series.dt.day_name PR01,PR02" \
-i "pandas.Series.dt.floor PR01,PR02" \
-i "pandas.Series.dt.month_name PR01,PR02" \
-i "pandas.Series.dt.normalize PR01" \
-i "pandas.Series.dt.round PR01,PR02" \
-i "pandas.Series.dt.strftime PR01,PR02" \
-i "pandas.Series.dt.total_seconds PR01" \
-i "pandas.Series.dt.tz_convert PR01,PR02" \
-i "pandas.Series.dt.tz_localize PR01,PR02" \
```
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59878/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59878/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59877 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59877/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59877/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59877/events | https://github.com/pandas-dev/pandas/issues/59877 | 2,542,255,501 | I_kwDOAA0YD86Xh72N | 59,877 | ENH: Adding `\cline`s to LaTeX table if index is not output | {
"login": "edbennett",
"id": 1698405,
"node_id": "MDQ6VXNlcjE2OTg0MDU=",
"avatar_url": "https://avatars.githubusercontent.com/u/1698405?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/edbennett",
"html_url": "https://github.com/edbennett",
"followers_url": "https://api.github.com/users/edbennett/followers",
"following_url": "https://api.github.com/users/edbennett/following{/other_user}",
"gists_url": "https://api.github.com/users/edbennett/gists{/gist_id}",
"starred_url": "https://api.github.com/users/edbennett/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/edbennett/subscriptions",
"organizations_url": "https://api.github.com/users/edbennett/orgs",
"repos_url": "https://api.github.com/users/edbennett/repos",
"events_url": "https://api.github.com/users/edbennett/events{/privacy}",
"received_events_url": "https://api.github.com/users/edbennett/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 76812,
"node_id": "MDU6TGFiZWw3NjgxMg==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Enhancement",
"name": "Enhancement",
"color": "4E9A06",
"default": false,
"description": null
},
{
"id": 251382258,
"node_id": "MDU6TGFiZWwyNTEzODIyNTg=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/IO%20LaTeX",
"name": "IO LaTeX",
"color": "006b75",
"default": false,
"description": "to_latex"
}
] | open | false | null | [] | null | 3 | 2024-09-23T10:44:55 | 2024-09-27T19:11:16 | null | NONE | null | null | null | ### Pandas version checks
- [X] I have checked that this issue has not already been reported.
- [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas.
- [X] I have confirmed this bug exists on the [main branch](https://pandas.pydata.org/docs/dev/getting_started/install.html#installing-the-development-version-of-pandas) of pandas.
### Reproducible Example
```python
import pandas as pd
df = pd.DataFrame(
[
{"a": 1, "b": 2, "c": 3},
{"a": 1, "b": 3, "c": 5},
{"a": 2, "b": 9, "c": 12},
{"a": 3, "b": 2, "c": 123},
]
)
print(
df.set_index("a").style.hide(axis=0).to_latex(clines="all;data", hrules=True)
)
```
### Issue Description
I am trying to output a LaTeX table with groups separated by `\cline`s but where the grouping variable is not shown in the table. I had thought that having the grouping in the index, but hiding the index in the output table, would allow this to happen; however, instead specifying `clines="all;data"` does nothing when the index is hidden.
### Expected Behavior
I would expect the example above to output
```latex
\begin{tabular}{rr}
\toprule
b & c \\
\midrule
2 & 3 \\
\cline{1-2}
3 & 5 \\
\cline{1-2}
9 & 12 \\
\cline{1-2}
2 & 123 \\
\bottomrule
\end{tabular}
```
Currently it outputs
```latex
\begin{tabular}{rr}
\toprule
b & c \\
\midrule
2 & 3 \\
3 & 5 \\
9 & 12 \\
2 & 123 \\
\bottomrule
\end{tabular}
```
(Ideally I would want it to output
```latex
\begin{tabular}{rr}
\toprule
b & c \\
\midrule
2 & 3 \\
3 & 5 \\
\cline{1-2}
9 & 12 \\
\cline{1-2}
2 & 123 \\
\bottomrule
\end{tabular}
```
but there is a problem with the way that I am creating the index, which is unrelated to the issue at hand.)
### Installed Versions
INSTALLED VERSIONS
------------------
commit : 71b395f2cf513f7c4ef8b50c608072bf3950e596
python : 3.12.6
python-bits : 64
OS : Darwin
OS-release : 23.6.0
Version : Darwin Kernel Version 23.6.0: Mon Jul 29 21:14:30 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T6000
machine : arm64
processor : arm
byteorder : little
LC_ALL : None
LANG : en_GB.UTF-8
LOCALE : en_GB.UTF-8
pandas : 3.0.0.dev0+1497.g71b395f2cf
numpy : 2.1.1
dateutil : 2.9.0.post0
pip : 24.2
Cython : None
sphinx : None
IPython : 8.27.0
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : None
blosc : None
bottleneck : None
fastparquet : None
fsspec : None
html5lib : None
hypothesis : None
gcsfs : None
jinja2 : 3.1.4
lxml.etree : None
matplotlib : None
numba : None
numexpr : None
odfpy : None
openpyxl : None
psycopg2 : None
pymysql : None
pyarrow : None
pyreadstat : None
pytest : None
python-calamine : None
pytz : 2024.2
pyxlsb : None
s3fs : None
scipy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlsxwriter : None
zstandard : None
tzdata : 2024.1
qtpy : None
pyqt5 : None
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59877/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59877/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59875 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59875/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59875/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59875/events | https://github.com/pandas-dev/pandas/pull/59875 | 2,541,878,494 | PR_kwDOAA0YD858VDrW | 59,875 | TST: update frame method quantile tests | {
"login": "jorisvandenbossche",
"id": 1020496,
"node_id": "MDQ6VXNlcjEwMjA0OTY=",
"avatar_url": "https://avatars.githubusercontent.com/u/1020496?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/jorisvandenbossche",
"html_url": "https://github.com/jorisvandenbossche",
"followers_url": "https://api.github.com/users/jorisvandenbossche/followers",
"following_url": "https://api.github.com/users/jorisvandenbossche/following{/other_user}",
"gists_url": "https://api.github.com/users/jorisvandenbossche/gists{/gist_id}",
"starred_url": "https://api.github.com/users/jorisvandenbossche/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jorisvandenbossche/subscriptions",
"organizations_url": "https://api.github.com/users/jorisvandenbossche/orgs",
"repos_url": "https://api.github.com/users/jorisvandenbossche/repos",
"events_url": "https://api.github.com/users/jorisvandenbossche/events{/privacy}",
"received_events_url": "https://api.github.com/users/jorisvandenbossche/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 57522093,
"node_id": "MDU6TGFiZWw1NzUyMjA5Mw==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Strings",
"name": "Strings",
"color": "5319e7",
"default": false,
"description": "String extension data type and string data"
}
] | open | false | null | [] | {
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/102",
"html_url": "https://github.com/pandas-dev/pandas/milestone/102",
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/102/labels",
"id": 9021906,
"node_id": "MI_kwDOAA0YD84AianS",
"number": 102,
"title": "3.0",
"description": "",
"creator": {
"login": "jbrockmendel",
"id": 8078968,
"node_id": "MDQ6VXNlcjgwNzg5Njg=",
"avatar_url": "https://avatars.githubusercontent.com/u/8078968?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/jbrockmendel",
"html_url": "https://github.com/jbrockmendel",
"followers_url": "https://api.github.com/users/jbrockmendel/followers",
"following_url": "https://api.github.com/users/jbrockmendel/following{/other_user}",
"gists_url": "https://api.github.com/users/jbrockmendel/gists{/gist_id}",
"starred_url": "https://api.github.com/users/jbrockmendel/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jbrockmendel/subscriptions",
"organizations_url": "https://api.github.com/users/jbrockmendel/orgs",
"repos_url": "https://api.github.com/users/jbrockmendel/repos",
"events_url": "https://api.github.com/users/jbrockmendel/events{/privacy}",
"received_events_url": "https://api.github.com/users/jbrockmendel/received_events",
"type": "User",
"site_admin": false
},
"open_issues": 42,
"closed_issues": 1325,
"state": "open",
"created_at": "2023-02-08T18:16:49",
"updated_at": "2024-10-08T02:35:04",
"due_on": null,
"closed_at": null
} | 0 | 2024-09-23T08:04:29 | 2024-09-23T08:04:30 | null | MEMBER | null | false | {
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/59875",
"html_url": "https://github.com/pandas-dev/pandas/pull/59875",
"diff_url": "https://github.com/pandas-dev/pandas/pull/59875.diff",
"patch_url": "https://github.com/pandas-dev/pandas/pull/59875.patch",
"merged_at": null
} | xref https://github.com/pandas-dev/pandas/issues/54792
(this doesn't need to be backported to 2.3.x because we only fixed it recently to properly preserve the index dtype for empty results in https://github.com/pandas-dev/pandas/pull/59035) | null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59875/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59875/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59873 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59873/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59873/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59873/events | https://github.com/pandas-dev/pandas/pull/59873 | 2,541,083,390 | PR_kwDOAA0YD858SY-R | 59,873 | Fix Docstring Issues for pandas.Series.sparse.sp_values and pandas.Series.str.match (Issue #59592) | {
"login": "syeda-fajar",
"id": 121845844,
"node_id": "U_kgDOB0M4VA",
"avatar_url": "https://avatars.githubusercontent.com/u/121845844?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/syeda-fajar",
"html_url": "https://github.com/syeda-fajar",
"followers_url": "https://api.github.com/users/syeda-fajar/followers",
"following_url": "https://api.github.com/users/syeda-fajar/following{/other_user}",
"gists_url": "https://api.github.com/users/syeda-fajar/gists{/gist_id}",
"starred_url": "https://api.github.com/users/syeda-fajar/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/syeda-fajar/subscriptions",
"organizations_url": "https://api.github.com/users/syeda-fajar/orgs",
"repos_url": "https://api.github.com/users/syeda-fajar/repos",
"events_url": "https://api.github.com/users/syeda-fajar/events{/privacy}",
"received_events_url": "https://api.github.com/users/syeda-fajar/received_events",
"type": "User",
"site_admin": false
} | [] | open | false | null | [] | null | 2 | 2024-09-22T13:32:00 | 2024-10-08T02:45:12 | null | NONE | null | false | {
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/59873",
"html_url": "https://github.com/pandas-dev/pandas/pull/59873",
"diff_url": "https://github.com/pandas-dev/pandas/pull/59873.diff",
"patch_url": "https://github.com/pandas-dev/pandas/pull/59873.patch",
"merged_at": null
} | This pull request addresses the following issues:
- Fixed docstring for pandas.Series.sparse.sp_values: ES01, SA01
- Fixed docstring for pandas.Series.str.match: ES01
- Removed the corresponding methods from the code_checks.sh script.
- [x] Part of #59592(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
- [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.
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59873/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59873/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59853 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59853/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59853/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59853/events | https://github.com/pandas-dev/pandas/pull/59853 | 2,539,768,115 | PR_kwDOAA0YD858OE19 | 59,853 | String dtype: implement sum reduction | {
"login": "jorisvandenbossche",
"id": 1020496,
"node_id": "MDQ6VXNlcjEwMjA0OTY=",
"avatar_url": "https://avatars.githubusercontent.com/u/1020496?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/jorisvandenbossche",
"html_url": "https://github.com/jorisvandenbossche",
"followers_url": "https://api.github.com/users/jorisvandenbossche/followers",
"following_url": "https://api.github.com/users/jorisvandenbossche/following{/other_user}",
"gists_url": "https://api.github.com/users/jorisvandenbossche/gists{/gist_id}",
"starred_url": "https://api.github.com/users/jorisvandenbossche/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jorisvandenbossche/subscriptions",
"organizations_url": "https://api.github.com/users/jorisvandenbossche/orgs",
"repos_url": "https://api.github.com/users/jorisvandenbossche/repos",
"events_url": "https://api.github.com/users/jorisvandenbossche/events{/privacy}",
"received_events_url": "https://api.github.com/users/jorisvandenbossche/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 57522093,
"node_id": "MDU6TGFiZWw1NzUyMjA5Mw==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Strings",
"name": "Strings",
"color": "5319e7",
"default": false,
"description": "String extension data type and string data"
},
{
"id": 2365504383,
"node_id": "MDU6TGFiZWwyMzY1NTA0Mzgz",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Reduction%20Operations",
"name": "Reduction Operations",
"color": "547c03",
"default": false,
"description": "sum, mean, min, max, etc."
}
] | open | false | null | [] | {
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/119",
"html_url": "https://github.com/pandas-dev/pandas/milestone/119",
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/119/labels",
"id": 11466880,
"node_id": "MI_kwDOAA0YD84ArviA",
"number": 119,
"title": "2.3",
"description": "on-merge: backport to 2.3.x",
"creator": {
"login": "jorisvandenbossche",
"id": 1020496,
"node_id": "MDQ6VXNlcjEwMjA0OTY=",
"avatar_url": "https://avatars.githubusercontent.com/u/1020496?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/jorisvandenbossche",
"html_url": "https://github.com/jorisvandenbossche",
"followers_url": "https://api.github.com/users/jorisvandenbossche/followers",
"following_url": "https://api.github.com/users/jorisvandenbossche/following{/other_user}",
"gists_url": "https://api.github.com/users/jorisvandenbossche/gists{/gist_id}",
"starred_url": "https://api.github.com/users/jorisvandenbossche/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jorisvandenbossche/subscriptions",
"organizations_url": "https://api.github.com/users/jorisvandenbossche/orgs",
"repos_url": "https://api.github.com/users/jorisvandenbossche/repos",
"events_url": "https://api.github.com/users/jorisvandenbossche/events{/privacy}",
"received_events_url": "https://api.github.com/users/jorisvandenbossche/received_events",
"type": "User",
"site_admin": false
},
"open_issues": 37,
"closed_issues": 70,
"state": "open",
"created_at": "2024-08-20T19:39:44",
"updated_at": "2024-10-03T20:12:23",
"due_on": null,
"closed_at": null
} | 3 | 2024-09-20T22:23:56 | 2024-09-22T19:04:26 | null | MEMBER | null | false | {
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/59853",
"html_url": "https://github.com/pandas-dev/pandas/pull/59853",
"diff_url": "https://github.com/pandas-dev/pandas/pull/59853.diff",
"patch_url": "https://github.com/pandas-dev/pandas/pull/59853.patch",
"merged_at": null
} | Based on the feedback in https://github.com/pandas-dev/pandas/issues/59328, implementing `sum()` for the string dtype
xref https://github.com/pandas-dev/pandas/issues/54792 | null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59853/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59853/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59846 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59846/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59846/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59846/events | https://github.com/pandas-dev/pandas/issues/59846 | 2,538,152,238 | I_kwDOAA0YD86XSSEu | 59,846 | BUG: Automatic change of color when the plot type is "line" but not when it is "scatter" | {
"login": "TinoDerb",
"id": 81869266,
"node_id": "MDQ6VXNlcjgxODY5MjY2",
"avatar_url": "https://avatars.githubusercontent.com/u/81869266?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/TinoDerb",
"html_url": "https://github.com/TinoDerb",
"followers_url": "https://api.github.com/users/TinoDerb/followers",
"following_url": "https://api.github.com/users/TinoDerb/following{/other_user}",
"gists_url": "https://api.github.com/users/TinoDerb/gists{/gist_id}",
"starred_url": "https://api.github.com/users/TinoDerb/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/TinoDerb/subscriptions",
"organizations_url": "https://api.github.com/users/TinoDerb/orgs",
"repos_url": "https://api.github.com/users/TinoDerb/repos",
"events_url": "https://api.github.com/users/TinoDerb/events{/privacy}",
"received_events_url": "https://api.github.com/users/TinoDerb/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 76811,
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug",
"name": "Bug",
"color": "e10c02",
"default": false,
"description": null
},
{
"id": 1954720290,
"node_id": "MDU6TGFiZWwxOTU0NzIwMjkw",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Needs%20Triage",
"name": "Needs Triage",
"color": "0052cc",
"default": false,
"description": "Issue that has not been reviewed by a pandas team member"
}
] | open | false | null | [] | null | 3 | 2024-09-20T07:59:41 | 2024-09-24T11:07:12 | null | NONE | null | null | null | ### Pandas version checks
- [X] I have checked that this issue has not already been reported.
- [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas.
- [x] I have confirmed this bug exists on the [main branch](https://pandas.pydata.org/docs/dev/getting_started/install.html#installing-the-development-version-of-pandas) of pandas.
### Reproducible Example
```python
import pandas as pd
import matplotlib.pyplot as plt
# I am using Jupyter. and my backend is notebook, for this, I use %matplotlib notebook
data = {'y': [1,2,3,4,5,6,7,8,9,10],
'x': [1,2,3,4,5,6,7,8,9,10],
'layer' : ['a','a','a','b','b','b','c','c','c','c']}
df = pd.DataFrame(data)
plt.figure()
df.groupby("layer").plot(x='x', y='y', ax= plt.gca(), kind='line') # this changes the color automatically
plt.figure()
df.groupby("layer").plot(x='x', y='y', ax= plt.gca(), kind='scatter') # this does not
```
### Issue Description
I was trying to write an asnwer on [stackoverflow](https://stackoverflow.com/questions/79003328/scatter-plot-legend-with-colors-for-a-string-attribute-in-complex-dataframe-usin/79005775#79005775) and I noticed the following behaviour:
Using `df.groupby("layer").plot(x='x', y='y', ax= plt.gca(), kind='line')` changes the color of every new group automatically.

This is however not seen when using `kind="scatter"`.

I think my version is a bit older than the latest one, but I could not find any similar issue on github.
### Expected Behavior
I expect that the color should also change for the scatter kind. For this, here is the output of the following code:
```
plt.figure()
for layer in df['layer'].unique(): # group by layer
subDf = df[df['layer'] == layer] # get subset of dataframe
plt.scatter(subDf['x'], subDf['y'], label=layer) # plot
# add labels and such
plt.xlabel('x')
plt.ylabel('y')
```

### Installed Versions
<details>
commit : 0f437949513225922d851e9581723d82120684a6
python : 3.11.5.final.0
python-bits : 64
OS : Windows
OS-release : 10
Version : 10.0.22631
machine : AMD64
processor : Intel64 Family 6 Model 186 Stepping 3, GenuineIntel
byteorder : little
LC_ALL : None
LANG : None
LOCALE : English_United States.1252
pandas : 2.0.3
numpy : 1.24.3
pytz : 2023.3.post1
dateutil : 2.8.2
setuptools : 68.0.0
pip : 23.2.1
Cython : 3.0.6
pytest : 7.4.0
hypothesis : None
sphinx : 5.0.2
blosc : None
feather : None
xlsxwriter : None
lxml.etree : 4.9.3
html5lib : 1.1
pymysql : None
psycopg2 : None
jinja2 : 3.1.2
IPython : 8.15.0
pandas_datareader: None
bs4 : 4.12.2
bottleneck : 1.3.5
brotli :
fastparquet : None
fsspec : 2023.4.0
gcsfs : None
matplotlib : 3.7.2
numba : 0.57.1
numexpr : 2.8.4
odfpy : None
openpyxl : 3.0.10
pandas_gbq : None
pyarrow : 11.0.0
pyreadstat : None
pyxlsb : None
s3fs : 2023.4.0
scipy : 1.11.1
snappy :
sqlalchemy : 1.4.39
tables : 3.8.0
tabulate : 0.8.10
xarray : 2023.6.0
xlrd : None
zstandard : 0.19.0
tzdata : 2023.3
qtpy : 2.2.0
pyqt5 : None
</details>
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59846/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59846/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59845 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59845/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59845/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59845/events | https://github.com/pandas-dev/pandas/issues/59845 | 2,537,801,231 | I_kwDOAA0YD86XQ8YP | 59,845 | BUG: pd.options.future.no_silent_downcasting is not backward compatible | {
"login": "vityas",
"id": 12552690,
"node_id": "MDQ6VXNlcjEyNTUyNjkw",
"avatar_url": "https://avatars.githubusercontent.com/u/12552690?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/vityas",
"html_url": "https://github.com/vityas",
"followers_url": "https://api.github.com/users/vityas/followers",
"following_url": "https://api.github.com/users/vityas/following{/other_user}",
"gists_url": "https://api.github.com/users/vityas/gists{/gist_id}",
"starred_url": "https://api.github.com/users/vityas/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/vityas/subscriptions",
"organizations_url": "https://api.github.com/users/vityas/orgs",
"repos_url": "https://api.github.com/users/vityas/repos",
"events_url": "https://api.github.com/users/vityas/events{/privacy}",
"received_events_url": "https://api.github.com/users/vityas/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 76811,
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug",
"name": "Bug",
"color": "e10c02",
"default": false,
"description": null
},
{
"id": 307649777,
"node_id": "MDU6TGFiZWwzMDc2NDk3Nzc=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Needs%20Info",
"name": "Needs Info",
"color": "207de5",
"default": false,
"description": "Clarification about behavior needed to assess issue"
},
{
"id": 6217899606,
"node_id": "LA_kwDOAA0YD88AAAABcp2eVg",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/PDEP6-related",
"name": "PDEP6-related",
"color": "9240E6",
"default": false,
"description": "related to PDEP6 (not upcasting during setitem-like Series operations)"
}
] | open | false | null | [] | null | 1 | 2024-09-20T04:07:00 | 2024-09-23T01:46:24 | null | NONE | null | null | null | ### Pandas version checks
- [X] I have checked that this issue has not already been reported.
- [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas.
- [X] I have confirmed this bug exists on the [main branch](https://pandas.pydata.org/docs/dev/getting_started/install.html#installing-the-development-version-of-pandas) of pandas.
### Reproducible Example
```python
with pd.option_context('future.no_silent_downcasting', True):
pd.Series([None]).fillna(False)
```
### Issue Description
I was not able to find a code that doesn't throw warnings for pandas >= 2.0. The example will work in pandas 2.2, but will break for earlier versions. Ahem... This is probably the first time in my Python development that a backwards incompatible change has been issued with a backwards incompatible workaround.
### Expected Behavior
Not throw any warning.
i could do something like this
```python
if pandas.__version__ >= '2.2.0':
with pd.option_context('future.no_silent_downcasting', True):
pd.Series([None]).fillna(False)
else:
pd.Series([None]).fillna(False)
```
I suppose this code would work, but it's a bad code.
### Installed Versions
<details>
pandas : 2.2.2
numpy : 1.26.3
pytz : 2024.1
dateutil : 2.8.1
</details>
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59845/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59845/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59844 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59844/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59844/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59844/events | https://github.com/pandas-dev/pandas/pull/59844 | 2,537,693,781 | PR_kwDOAA0YD858G-P6 | 59,844 | timedelta on datetime df, series arithmetic | {
"login": "sukriti1",
"id": 42755203,
"node_id": "MDQ6VXNlcjQyNzU1MjAz",
"avatar_url": "https://avatars.githubusercontent.com/u/42755203?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/sukriti1",
"html_url": "https://github.com/sukriti1",
"followers_url": "https://api.github.com/users/sukriti1/followers",
"following_url": "https://api.github.com/users/sukriti1/following{/other_user}",
"gists_url": "https://api.github.com/users/sukriti1/gists{/gist_id}",
"starred_url": "https://api.github.com/users/sukriti1/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sukriti1/subscriptions",
"organizations_url": "https://api.github.com/users/sukriti1/orgs",
"repos_url": "https://api.github.com/users/sukriti1/repos",
"events_url": "https://api.github.com/users/sukriti1/events{/privacy}",
"received_events_url": "https://api.github.com/users/sukriti1/received_events",
"type": "User",
"site_admin": false
} | [] | open | false | null | [] | null | 0 | 2024-09-20T02:29:07 | 2024-10-04T02:25:37 | null | CONTRIBUTOR | null | false | {
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/59844",
"html_url": "https://github.com/pandas-dev/pandas/pull/59844",
"diff_url": "https://github.com/pandas-dev/pandas/pull/59844.diff",
"patch_url": "https://github.com/pandas-dev/pandas/pull/59844.patch",
"merged_at": null
} | - [x] closes #59529 (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.
- [x] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59844/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59844/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59841 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59841/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59841/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59841/events | https://github.com/pandas-dev/pandas/issues/59841 | 2,537,124,932 | I_kwDOAA0YD86XOXRE | 59,841 | BUG: to_sql with ADBC driver fails when schema exists without tables | {
"login": "WillAyd",
"id": 609873,
"node_id": "MDQ6VXNlcjYwOTg3Mw==",
"avatar_url": "https://avatars.githubusercontent.com/u/609873?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/WillAyd",
"html_url": "https://github.com/WillAyd",
"followers_url": "https://api.github.com/users/WillAyd/followers",
"following_url": "https://api.github.com/users/WillAyd/following{/other_user}",
"gists_url": "https://api.github.com/users/WillAyd/gists{/gist_id}",
"starred_url": "https://api.github.com/users/WillAyd/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/WillAyd/subscriptions",
"organizations_url": "https://api.github.com/users/WillAyd/orgs",
"repos_url": "https://api.github.com/users/WillAyd/repos",
"events_url": "https://api.github.com/users/WillAyd/events{/privacy}",
"received_events_url": "https://api.github.com/users/WillAyd/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 76811,
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug",
"name": "Bug",
"color": "e10c02",
"default": false,
"description": null
},
{
"id": 47232590,
"node_id": "MDU6TGFiZWw0NzIzMjU5MA==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/IO%20SQL",
"name": "IO SQL",
"color": "5319e7",
"default": false,
"description": "to_sql, read_sql, read_sql_query"
}
] | open | false | {
"login": "aram-cinnamon",
"id": 97805700,
"node_id": "U_kgDOBdRlhA",
"avatar_url": "https://avatars.githubusercontent.com/u/97805700?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/aram-cinnamon",
"html_url": "https://github.com/aram-cinnamon",
"followers_url": "https://api.github.com/users/aram-cinnamon/followers",
"following_url": "https://api.github.com/users/aram-cinnamon/following{/other_user}",
"gists_url": "https://api.github.com/users/aram-cinnamon/gists{/gist_id}",
"starred_url": "https://api.github.com/users/aram-cinnamon/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/aram-cinnamon/subscriptions",
"organizations_url": "https://api.github.com/users/aram-cinnamon/orgs",
"repos_url": "https://api.github.com/users/aram-cinnamon/repos",
"events_url": "https://api.github.com/users/aram-cinnamon/events{/privacy}",
"received_events_url": "https://api.github.com/users/aram-cinnamon/received_events",
"type": "User",
"site_admin": false
} | [
{
"login": "aram-cinnamon",
"id": 97805700,
"node_id": "U_kgDOBdRlhA",
"avatar_url": "https://avatars.githubusercontent.com/u/97805700?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/aram-cinnamon",
"html_url": "https://github.com/aram-cinnamon",
"followers_url": "https://api.github.com/users/aram-cinnamon/followers",
"following_url": "https://api.github.com/users/aram-cinnamon/following{/other_user}",
"gists_url": "https://api.github.com/users/aram-cinnamon/gists{/gist_id}",
"starred_url": "https://api.github.com/users/aram-cinnamon/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/aram-cinnamon/subscriptions",
"organizations_url": "https://api.github.com/users/aram-cinnamon/orgs",
"repos_url": "https://api.github.com/users/aram-cinnamon/repos",
"events_url": "https://api.github.com/users/aram-cinnamon/events{/privacy}",
"received_events_url": "https://api.github.com/users/aram-cinnamon/received_events",
"type": "User",
"site_admin": false
},
{
"login": "KevsterAmp",
"id": 109636487,
"node_id": "U_kgDOBojrhw",
"avatar_url": "https://avatars.githubusercontent.com/u/109636487?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/KevsterAmp",
"html_url": "https://github.com/KevsterAmp",
"followers_url": "https://api.github.com/users/KevsterAmp/followers",
"following_url": "https://api.github.com/users/KevsterAmp/following{/other_user}",
"gists_url": "https://api.github.com/users/KevsterAmp/gists{/gist_id}",
"starred_url": "https://api.github.com/users/KevsterAmp/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/KevsterAmp/subscriptions",
"organizations_url": "https://api.github.com/users/KevsterAmp/orgs",
"repos_url": "https://api.github.com/users/KevsterAmp/repos",
"events_url": "https://api.github.com/users/KevsterAmp/events{/privacy}",
"received_events_url": "https://api.github.com/users/KevsterAmp/received_events",
"type": "User",
"site_admin": false
}
] | null | 2 | 2024-09-19T18:48:46 | 2024-10-03T11:24:28 | null | MEMBER | null | null | null | ### Pandas version checks
- [X] I have checked that this issue has not already been reported.
- [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas.
- [X] I have confirmed this bug exists on the [main branch](https://pandas.pydata.org/docs/dev/getting_started/install.html#installing-the-development-version-of-pandas) of pandas.
### Reproducible Example
This is hard to create a reproducer for given sqlite does not have schemas and is not affected by the issue. However, with the proper database setup running code like:
```python
with adbc_driver_postgresql.dbapi.connect() as conn:
df.to_sql("table", schema="schema_with_no_tables")
```
Will produce the following traceback:
```sh
File ~/micromamba/envs/youtube-demo/lib/python3.12/site-packages/pandas/util/_decorators.py:333, in deprecate_nonkeyword_arguments.<locals>.decorate.<locals>.wrapper(*args, **kwargs)
327 if len(args) > num_allow_args:
328 warnings.warn(
329 msg.format(arguments=_format_argument_list(allow_args)),
330 FutureWarning,
331 stacklevel=find_stack_level(),
332 )
--> 333 return func(*args, **kwargs)
File ~/micromamba/envs/youtube-demo/lib/python3.12/site-packages/pandas/core/generic.py:3087, in NDFrame.to_sql(self, name, con, schema, if_exists, index, index_label, chunksize, dtype, method)
2889 """
2890 Write records stored in a DataFrame to a SQL database.
2891
(...)
3083 [(1,), (None,), (2,)]
3084 """ # noqa: E501
3085 from pandas.io import sql
-> 3087 return sql.to_sql(
3088 self,
3089 name,
3090 con,
3091 schema=schema,
3092 if_exists=if_exists,
3093 index=index,
3094 index_label=index_label,
3095 chunksize=chunksize,
3096 dtype=dtype,
3097 method=method,
3098 )
File ~/micromamba/envs/youtube-demo/lib/python3.12/site-packages/pandas/io/sql.py:842, in to_sql(frame, name, con, schema, if_exists, index, index_label, chunksize, dtype, method, engine, **engine_kwargs)
837 raise NotImplementedError(
838 "'frame' argument should be either a Series or a DataFrame"
839 )
841 with pandasSQL_builder(con, schema=schema, need_transaction=True) as pandas_sql:
--> 842 return pandas_sql.to_sql(
843 frame,
844 name,
845 if_exists=if_exists,
846 index=index,
847 index_label=index_label,
848 schema=schema,
849 chunksize=chunksize,
850 dtype=dtype,
851 method=method,
852 engine=engine,
853 **engine_kwargs,
854 )
File ~/micromamba/envs/youtube-demo/lib/python3.12/site-packages/pandas/io/sql.py:2386, in ADBCDatabase.to_sql(self, frame, name, if_exists, index, index_label, schema, chunksize, dtype, method, engine, **engine_kwargs)
2381 # pandas if_exists="append" will still create the
2382 # table if it does not exist; ADBC is more explicit with append/create
2383 # as applicable modes, so the semantics get blurred across
2384 # the libraries
2385 mode = "create"
-> 2386 if self.has_table(name, schema):
2387 if if_exists == "fail":
2388 raise ValueError(f"Table '{table_name}' already exists.")
File ~/micromamba/envs/youtube-demo/lib/python3.12/site-packages/pandas/io/sql.py:2422, in ADBCDatabase.has_table(self, name, schema)
2419 if not schema_record:
2420 continue
-> 2422 for table_record in schema_record["db_schema_tables"]:
2423 if table_record["table_name"] == name:
2424 return True
TypeError: 'NoneType' object is not iterable
```
```
```
### Issue Description
The pandas code does not handle well the case where `schema_record["db_schema_tables"]` may be `None`
### Expected Behavior
No error
### Installed Versions
2.2.2 | null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59841/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59841/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59833 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59833/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59833/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59833/events | https://github.com/pandas-dev/pandas/issues/59833 | 2,533,850,876 | I_kwDOAA0YD86XB378 | 59,833 | BUG: Timestamp.tz and DatetimeIndex.tz are inconsistent when pytz 2024.2 is installed | {
"login": "boschmic",
"id": 64787243,
"node_id": "MDQ6VXNlcjY0Nzg3MjQz",
"avatar_url": "https://avatars.githubusercontent.com/u/64787243?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/boschmic",
"html_url": "https://github.com/boschmic",
"followers_url": "https://api.github.com/users/boschmic/followers",
"following_url": "https://api.github.com/users/boschmic/following{/other_user}",
"gists_url": "https://api.github.com/users/boschmic/gists{/gist_id}",
"starred_url": "https://api.github.com/users/boschmic/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/boschmic/subscriptions",
"organizations_url": "https://api.github.com/users/boschmic/orgs",
"repos_url": "https://api.github.com/users/boschmic/repos",
"events_url": "https://api.github.com/users/boschmic/events{/privacy}",
"received_events_url": "https://api.github.com/users/boschmic/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 60458168,
"node_id": "MDU6TGFiZWw2MDQ1ODE2OA==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Timezones",
"name": "Timezones",
"color": "5319e7",
"default": false,
"description": "Timezone data dtype"
},
{
"id": 76865106,
"node_id": "MDU6TGFiZWw3Njg2NTEwNg==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Compat",
"name": "Compat",
"color": "0052cc",
"default": false,
"description": "pandas objects compatability with Numpy or Python functions"
},
{
"id": 527603109,
"node_id": "MDU6TGFiZWw1Mjc2MDMxMDk=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Dependencies",
"name": "Dependencies",
"color": "d93f0b",
"default": false,
"description": "Required and optional dependencies"
},
{
"id": 2365504893,
"node_id": "MDU6TGFiZWwyMzY1NTA0ODkz",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Closing%20Candidate",
"name": "Closing Candidate",
"color": "be21f2",
"default": false,
"description": "May be closeable, needs more eyeballs"
}
] | open | false | null | [] | null | 2 | 2024-09-18T14:06:30 | 2024-09-18T17:48:15 | null | NONE | null | null | null | ### Pandas version checks
- [X] I have checked that this issue has not already been reported.
- [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas.
- [ ] I have confirmed this bug exists on the [main branch](https://pandas.pydata.org/docs/dev/getting_started/install.html#installing-the-development-version-of-pandas) of pandas.
### Reproducible Example
```python
import pandas as pd
t0 = pd.Timestamp("01-01-2000")
print(repr(t0.tz_localize("CET").tz))
print(repr(pd.DatetimeIndex([t0]).tz_localize("CET").tz))
```
### Issue Description
If `pytz = "==2024.2"` is installed the example prints
```
<DstTzInfo 'CET' CET+1:00:00 STD>
<DstTzInfo 'CET' LMT+0:18:00 STD>
```
Downgrading `pytz`to `2024.1` resolves this issue.
### Expected Behavior
The `.tz` property should produce the same result regardless if the object is a `Timestamp` or `DatetimeIndex`. Hence, I expect this example to print
```
<DstTzInfo 'CET' CET+1:00:00 STD>
<DstTzInfo 'CET' CET+1:00:00 STD>
```
### Installed Versions
<details>
INSTALLED VERSIONS
------------------
commit : d9cdd2ee5a58015ef6f4d15c7226110c9aab8140
python : 3.11.10.final.0
python-bits : 64
OS : Linux
OS-release : 6.8.0-40-generic
Version : #40~22.04.3-Ubuntu SMP PREEMPT_DYNAMIC Tue Jul 30 17:30:19 UTC 2
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 2.2.2
numpy : 2.1.1
pytz : 2024.2
dateutil : 2.9.0.post0
setuptools : 69.2.0
pip : 24.0
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : None
IPython : None
pandas_datareader : None
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : None
bottleneck : None
dataframe-api-compat : None
fastparquet : None
fsspec : None
gcsfs : None
matplotlib : None
numba : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pyreadstat : None
python-calamine : None
pyxlsb : None
s3fs : None
scipy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
zstandard : None
tzdata : 2024.1
qtpy : None
pyqt5 : None
</details>
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59833/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59833/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59831 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59831/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59831/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59831/events | https://github.com/pandas-dev/pandas/issues/59831 | 2,533,316,109 | I_kwDOAA0YD86W_1YN | 59,831 | ENH: Restore the functionality of `.fillna` | {
"login": "tomprimozic",
"id": 84324,
"node_id": "MDQ6VXNlcjg0MzI0",
"avatar_url": "https://avatars.githubusercontent.com/u/84324?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/tomprimozic",
"html_url": "https://github.com/tomprimozic",
"followers_url": "https://api.github.com/users/tomprimozic/followers",
"following_url": "https://api.github.com/users/tomprimozic/following{/other_user}",
"gists_url": "https://api.github.com/users/tomprimozic/gists{/gist_id}",
"starred_url": "https://api.github.com/users/tomprimozic/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/tomprimozic/subscriptions",
"organizations_url": "https://api.github.com/users/tomprimozic/orgs",
"repos_url": "https://api.github.com/users/tomprimozic/repos",
"events_url": "https://api.github.com/users/tomprimozic/events{/privacy}",
"received_events_url": "https://api.github.com/users/tomprimozic/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 76812,
"node_id": "MDU6TGFiZWw3NjgxMg==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Enhancement",
"name": "Enhancement",
"color": "4E9A06",
"default": false,
"description": null
},
{
"id": 2822342,
"node_id": "MDU6TGFiZWwyODIyMzQy",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Missing-data",
"name": "Missing-data",
"color": "d7e102",
"default": false,
"description": "np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate"
},
{
"id": 31404521,
"node_id": "MDU6TGFiZWwzMTQwNDUyMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Dtype%20Conversions",
"name": "Dtype Conversions",
"color": "e102d8",
"default": false,
"description": "Unexpected or buggy dtype conversions"
},
{
"id": 219960758,
"node_id": "MDU6TGFiZWwyMTk5NjA3NTg=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Needs%20Discussion",
"name": "Needs Discussion",
"color": "207de5",
"default": false,
"description": "Requires discussion from core team before further action"
},
{
"id": 307649777,
"node_id": "MDU6TGFiZWwzMDc2NDk3Nzc=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Needs%20Info",
"name": "Needs Info",
"color": "207de5",
"default": false,
"description": "Clarification about behavior needed to assess issue"
}
] | open | false | null | [] | null | 2 | 2024-09-18T10:13:33 | 2024-09-24T18:33:33 | null | NONE | null | null | null | ### Feature Type
- [ ] Adding new functionality to pandas
- [X] Changing existing functionality in pandas
- [ ] Removing existing functionality in pandas
### Problem Description
The currently very useful behaviour of `.fillna` is being deprecated.
```python
a = pd.Series([True, False, None])
a
# 0 True
# 1 False
# 2 None
# dtype: object
```
Using `a.fillna` raises a warning:
```python
a.fillna(True)
# [/var/folders/66/bjmfs8315pjdbztwxmyvd7x80000gn/T/ipykernel_85835/3077193745.py:1](https://file+.vscode-resource.vscode-cdn.net/var/folders/66/bjmfs8315pjdbztwxmyvd7x80000gn/T/ipykernel_85835/3077193745.py:1): FutureWarning: Downcasting object dtype arrays on .fillna, .ffill, .bfill is deprecated and will change in a future version. Call result.infer_objects(copy=False) instead. To opt-in to the future behavior, set `pd.set_option('future.no_silent_downcasting', True)`
# a.fillna(True)
```
Full message of the warning is:
> FutureWarning: Downcasting object dtype arrays on .fillna, .ffill, .bfill is deprecated and will change in a future version. Call result.infer_objects(copy=False) instead. To opt-in to the future behavior, set `pd.set_option('future.no_silent_downcasting', True)`
The proposed solutions don't work:
```python
a.fillna(True).infer_objects(copy=False)
# [/var/folders/66/bjmfs8315pjdbztwxmyvd7x80000gn/T/ipykernel_85835/1224563968.py:1](https://file+.vscode-resource.vscode-cdn.net/var/folders/66/bjmfs8315pjdbztwxmyvd7x80000gn/T/ipykernel_85835/1224563968.py:1): FutureWarning: Downcasting object dtype arrays on .fillna, .ffill, .bfill is deprecated and will change in a future version. Call result.infer_objects(copy=False) instead. To opt-in to the future behavior, set `pd.set_option('future.no_silent_downcasting', True)`
# a.fillna(True).infer_objects(copy=False)
```
maybe I misunderstood the Warning message?
```python
a.infer_objects(copy=False).fillna(True)
# [/var/folders/66/bjmfs8315pjdbztwxmyvd7x80000gn/T/ipykernel_85835/2319989247.py:1](https://file+.vscode-resource.vscode-cdn.net/var/folders/66/bjmfs8315pjdbztwxmyvd7x80000gn/T/ipykernel_85835/2319989247.py:1): FutureWarning: Downcasting object dtype arrays on .fillna, .ffill, .bfill is deprecated and will change in a future version. Call result.infer_objects(copy=False) instead. To opt-in to the future behavior, set `pd.set_option('future.no_silent_downcasting', True)`
# a.infer_objects(copy=False).fillna(True) # maybe I misunderstood the message?
```
Let's try to opt-in...
```python
with pd.option_context("future.no_silent_downcasting", True):
r = a.fillna(True)
r
# 0 True
# 1 False
# 2 True
# dtype: object
```
No, it's no longer a `bool` Series...
Some online resources suggest first casting to `bool`...
```python
a.astype(bool)
# 0 True
# 1 False
# 2 False
# dtype: bool
```
Looks like this is a potential replacement for `.fillna(False)` but not for `.fillna(True)`...
Wait, there's a `downcast` parameter for `.fillna`!
```python
a.fillna(True, downcast=True)
# [/var/folders/66/bjmfs8315pjdbztwxmyvd7x80000gn/T/ipykernel_85835/4257582953.py:1](https://file+.vscode-resource.vscode-cdn.net/var/folders/66/bjmfs8315pjdbztwxmyvd7x80000gn/T/ipykernel_85835/4257582953.py:1): FutureWarning: The 'downcast' keyword in fillna is deprecated and will be removed in a future version. Use res.infer_objects(copy=False) to infer non-object dtype, or pd.to_numeric with the 'downcast' keyword to downcast numeric results.
# a.fillna(True, downcast=True)
# [/var/folders/66/bjmfs8315pjdbztwxmyvd7x80000gn/T/ipykernel_85835/4257582953.py:1](https://file+.vscode-resource.vscode-cdn.net/var/folders/66/bjmfs8315pjdbztwxmyvd7x80000gn/T/ipykernel_85835/4257582953.py:1): FutureWarning: Downcasting object dtype arrays on .fillna, .ffill, .bfill is deprecated and will change in a future version. Call result.infer_objects(copy=False) instead. To opt-in to the future behavior, set `pd.set_option('future.no_silent_downcasting', True)`
# a.fillna(True, downcast=True)
```
Oh no, it's _deprecated_ as well, not I got _TWO_ warnings...
### Feature Description
Restore the functionality of `.fillna` _WITHOUT_ the Warning.
```python
a = pd.Series([True, False, None])
a.fillna(True)
# 0 True
# 1 False
# 2 True
# dtype: bool
```
### Alternative Solutions
Currently, the only "correct" option is to use _nullable Boolean type_.
```python
a.astype('boolean').fillna(True).astype(bool)
# or, if we're happy keeping the type `boolean`...
a.astype('boolean').fillna(True)
```
This is overly verbose, but would be acceptable if `boolean` was inferred automatically for `[True, False, None]` (or `[True, False, np.nan]`), but currently it's not...
(The additional confusion is that _integer_ nullable types are distinguished by uppercase (`int64 -> Int64`) but _boolean_ nullable type isn't (`bool -> boolean`)... so it took me a very long time to even find this solution!)
### Additional Context
_No response_ | null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59831/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59831/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59827 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59827/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59827/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59827/events | https://github.com/pandas-dev/pandas/issues/59827 | 2,531,688,536 | I_kwDOAA0YD86W5oBY | 59,827 | ENH: Add parameter to read_html() that disables the _remove_whitespace() function | {
"login": "dstone42",
"id": 97193062,
"node_id": "U_kgDOBcsMZg",
"avatar_url": "https://avatars.githubusercontent.com/u/97193062?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/dstone42",
"html_url": "https://github.com/dstone42",
"followers_url": "https://api.github.com/users/dstone42/followers",
"following_url": "https://api.github.com/users/dstone42/following{/other_user}",
"gists_url": "https://api.github.com/users/dstone42/gists{/gist_id}",
"starred_url": "https://api.github.com/users/dstone42/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dstone42/subscriptions",
"organizations_url": "https://api.github.com/users/dstone42/orgs",
"repos_url": "https://api.github.com/users/dstone42/repos",
"events_url": "https://api.github.com/users/dstone42/events{/privacy}",
"received_events_url": "https://api.github.com/users/dstone42/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 76812,
"node_id": "MDU6TGFiZWw3NjgxMg==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Enhancement",
"name": "Enhancement",
"color": "4E9A06",
"default": false,
"description": null
},
{
"id": 57395487,
"node_id": "MDU6TGFiZWw1NzM5NTQ4Nw==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/IO%20HTML",
"name": "IO HTML",
"color": "006b75",
"default": false,
"description": "read_html, to_html, Styler.apply, Styler.applymap"
},
{
"id": 219960758,
"node_id": "MDU6TGFiZWwyMTk5NjA3NTg=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Needs%20Discussion",
"name": "Needs Discussion",
"color": "207de5",
"default": false,
"description": "Requires discussion from core team before further action"
}
] | open | false | null | [] | null | 8 | 2024-09-17T17:20:48 | 2024-09-27T18:35:40 | null | NONE | null | null | null | ### Feature Type
- [ ] Adding new functionality to pandas
- [X] Changing existing functionality in pandas
- [ ] Removing existing functionality in pandas
### Problem Description
I have an html file that shows question names from a surveilance survey and how they have changed over the years to merge multiple files with slightly different names from those different years. I need to read in this file with the text exactly as it is in the html file so that those question names map exactly to the ones I mine from a pdf. The _remove_whitespace() function replaces all of the extra whitespace with single spaces, but there are some errors in these column names where they accidentally put two spaces or other similar things, and I need that text to match exactly, so I can properly clean the other files in the dataset.
### Feature Description
Add a new parameter to the read_html() function that can disable the _remove_whitespace() function.
### Alternative Solutions
The file I am using is originally md that I converted to html because I didn't think there was a way to read from md into pandas. I recently found this out, so instead of converting to html and reading from that, I am reading straight from the md. However, if my original file was html, I would probably create a similar solution of going back down to the read_table() function and manually making the changes I want to the cleaning.
```
def read_md(filename):
table = pd.read_table(filename, sep='|').dropna(axis=1, how='all').iloc[1:]
table.columns = table.columns.str.strip()
for col in table.columns:
table[col] = table[col].str.strip()
return table.reset_index(drop=True)
```
### Additional Context
_No response_ | null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59827/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59827/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59826 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59826/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59826/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59826/events | https://github.com/pandas-dev/pandas/issues/59826 | 2,530,515,077 | I_kwDOAA0YD86W1JiF | 59,826 | BUG: is_unique fails when using float128 indexes, since pandas 2.0 | {
"login": "morotti",
"id": 13528994,
"node_id": "MDQ6VXNlcjEzNTI4OTk0",
"avatar_url": "https://avatars.githubusercontent.com/u/13528994?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/morotti",
"html_url": "https://github.com/morotti",
"followers_url": "https://api.github.com/users/morotti/followers",
"following_url": "https://api.github.com/users/morotti/following{/other_user}",
"gists_url": "https://api.github.com/users/morotti/gists{/gist_id}",
"starred_url": "https://api.github.com/users/morotti/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/morotti/subscriptions",
"organizations_url": "https://api.github.com/users/morotti/orgs",
"repos_url": "https://api.github.com/users/morotti/repos",
"events_url": "https://api.github.com/users/morotti/events{/privacy}",
"received_events_url": "https://api.github.com/users/morotti/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 76811,
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug",
"name": "Bug",
"color": "e10c02",
"default": false,
"description": null
},
{
"id": 219960758,
"node_id": "MDU6TGFiZWwyMTk5NjA3NTg=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Needs%20Discussion",
"name": "Needs Discussion",
"color": "207de5",
"default": false,
"description": "Requires discussion from core team before further action"
},
{
"id": 1218227310,
"node_id": "MDU6TGFiZWwxMjE4MjI3MzEw",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Index",
"name": "Index",
"color": "e99695",
"default": false,
"description": "Related to the Index class or subclasses"
}
] | open | false | null | [] | null | 5 | 2024-09-17T09:10:55 | 2024-09-22T13:40:06 | null | CONTRIBUTOR | null | null | null | ### Pandas version checks
- [X] I have checked that this issue has not already been reported.
- [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas.
- [ ] I have confirmed this bug exists on the [main branch](https://pandas.pydata.org/docs/dev/getting_started/install.html#installing-the-development-version-of-pandas) of pandas.
### Reproducible Example
Hello,
Noticed a regression when using float128. Code to reproduce the bug below.
* It works fine on pandas 1.0.5 + 1.5.3
* It fails on pandas 2.0.3 + 2.1.4 + 2.2.2
`is_unique` is failing on first call, then giving an incorrect result on later calls.
`is_monotonic_increasing` gives an incorrect result.
I think we have two bugs at play here.
1) is_unique is obviously bugged, failing raising an exception.
2) is_monotonic_increasing depends on is_unique and they are both cached. There may be a bug in the caching code not handling is_unique raising an exception.
```
import pandas as pd
idx = pd.Index([2.0, 4.0, 6.0, 8.0, 10.0, 12.0, 14.0, 16.0], dtype='float128')
print("pandas version? ", pd.__version__)
print("monotonic? ", idx.is_monotonic_increasing)
print("unique? ", idx.is_unique)
```
### Issue Description
First call of `is_unique` failing on pandas 2.2.2
```
# python debug_float128.py
pandas version? 2.2.2
monotonic? False
Traceback (most recent call last):
File "/users/is/rmorotti/debug_float128.py", line 5, in <module>
print("unique? ", idx.is_unique)
^^^^^^^^^^^^^
File "properties.pyx", line 36, in pandas._libs.properties.CachedProperty.__get__
File "/turbo/rmorotti/pyenvs/debugpandas/lib/python3.11/site-packages/pandas/core/indexes/base.py", line 2346, in is_unique
return self._engine.is_unique
^^^^^^^^^^^^^^^^^^^^^^
File "index.pyx", line 266, in pandas._libs.index.IndexEngine.is_unique.__get__
File "index.pyx", line 271, in pandas._libs.index.IndexEngine._do_unique_check
File "index.pyx", line 333, in pandas._libs.index.IndexEngine._ensure_mapping_populated
File "pandas/_libs/hashtable_class_helper.pxi", line 7105, in pandas._libs.hashtable.PyObjectHashTable.map_locations
ValueError: Buffer dtype mismatch, expected 'Python object' but got 'long double'
```
### Expected Behavior
Works fine on pandas 1.5.3
```
# python debug_float128.py
pandas version? 1.5.3
monotonic? True
unique? True
```
### Installed Versions
bug since pandas 2.0 | null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59826/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59826/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59823 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59823/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59823/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59823/events | https://github.com/pandas-dev/pandas/issues/59823 | 2,529,601,080 | I_kwDOAA0YD86WxqY4 | 59,823 | BUG: Empty column name in group dataframe when using pyarrow types | {
"login": "dbalabka",
"id": 1269372,
"node_id": "MDQ6VXNlcjEyNjkzNzI=",
"avatar_url": "https://avatars.githubusercontent.com/u/1269372?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/dbalabka",
"html_url": "https://github.com/dbalabka",
"followers_url": "https://api.github.com/users/dbalabka/followers",
"following_url": "https://api.github.com/users/dbalabka/following{/other_user}",
"gists_url": "https://api.github.com/users/dbalabka/gists{/gist_id}",
"starred_url": "https://api.github.com/users/dbalabka/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dbalabka/subscriptions",
"organizations_url": "https://api.github.com/users/dbalabka/orgs",
"repos_url": "https://api.github.com/users/dbalabka/repos",
"events_url": "https://api.github.com/users/dbalabka/events{/privacy}",
"received_events_url": "https://api.github.com/users/dbalabka/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 76811,
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug",
"name": "Bug",
"color": "e10c02",
"default": false,
"description": null
},
{
"id": 74975453,
"node_id": "MDU6TGFiZWw3NDk3NTQ1Mw==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Resample",
"name": "Resample",
"color": "207de5",
"default": false,
"description": "resample method"
}
] | open | false | null | [] | null | 13 | 2024-09-16T22:24:25 | 2024-09-25T14:15:46 | null | NONE | null | null | null | ### Pandas version checks
- [X] I have checked that this issue has not already been reported.
- [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas.
- [ ] I have confirmed this bug exists on the [main branch](https://pandas.pydata.org/docs/dev/getting_started/install.html#installing-the-development-version-of-pandas) of pandas.
### Reproducible Example
```python
import pandas as pd
data = {
'id': [1, 1, 1, 2, 2, 2],
'date': pd.to_datetime(['2023-01-01', '2023-01-04', '2023-01-05', '2023-01-01', '2023-01-04', '2023-01-05']),
'metric': [1,1,1,1,1,1]
}
df = pd.DataFrame(data).astype({'id': 'int64', 'metric': 'int64', 'date': 'timestamp[ns][pyarrow]'})
print(
df
.groupby(by=['id'])
.apply(lambda x: x.resample("D", on="date").sum(), include_groups=False)
)
```
### Issue Description
Group DataFrame column `date` should not be empty:
```
metric
id <----------------------- missing date column name
1 2023-01-01 00:00:00 1
2023-01-02 00:00:00 0
2023-01-03 00:00:00 0
2023-01-04 00:00:00 1
2023-01-05 00:00:00 1
2 2023-01-01 00:00:00 1
2023-01-02 00:00:00 0
2023-01-03 00:00:00 0
2023-01-04 00:00:00 1
2023-01-05 00:00:00 1
```
### Expected Behavior
The following snippet generates the Grouped DataFrame with expected column names:
```python
import pandas as pd
data = {
'id': [1, 1, 1, 2, 2, 2],
'date': pd.to_datetime(['2023-01-01', '2023-01-04', '2023-01-05', '2023-01-01', '2023-01-04', '2023-01-05']),
'metric': [1,1,1,1,1,1]
}
df = pd.DataFrame(data)
print(
df
.groupby(by=['id'])
.apply(lambda x: x.resample("D", on="date").sum(), include_groups=False)
)
```
```
metric
id date
1 2023-01-01 1
2023-01-02 0
2023-01-03 0
2023-01-04 1
2023-01-05 1
2 2023-01-01 1
2023-01-02 0
2023-01-03 0
2023-01-04 1
2023-01-05 1
```
### Installed Versions
<details>
UserWarning: Setuptools is replacing distutils.
INSTALLED VERSIONS
------------------
commit : d9cdd2ee5a58015ef6f4d15c7226110c9aab8140
python : 3.10.12.final.0
python-bits : 64
OS : Linux
OS-release : 5.15.153.1-microsoft-standard-WSL2
Version : #1 SMP Fri Mar 29 23:14:13 UTC 2024
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : en_US.UTF-8
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 2.2.2
numpy : 1.26.3
pytz : 2023.4
dateutil : 2.8.2
setuptools : 69.0.3
pip : 24.0
Cython : None
pytest : 7.4.4
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 3.1.3
IPython : 8.20.0
pandas_datareader : None
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : 4.12.3
bottleneck : None
dataframe-api-compat : None
fastparquet : None
fsspec : 2023.12.2
gcsfs : 2023.12.2post1
matplotlib : 3.8.2
numba : 0.58.1
numexpr : None
odfpy : None
openpyxl : 3.1.2
pandas_gbq : None
pyarrow : 14.0.2
pyreadstat : None
python-calamine : None
pyxlsb : None
s3fs : 2023.12.2
scipy : 1.12.0
sqlalchemy : 2.0.29
tables : None
tabulate : 0.9.0
xarray : None
xlrd : None
zstandard : None
tzdata : 2023.4
qtpy : None
pyqt5 : None
</details>
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59823/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59823/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59816 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59816/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59816/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59816/events | https://github.com/pandas-dev/pandas/pull/59816 | 2,527,831,932 | PR_kwDOAA0YD857loD3 | 59,816 | Bump pypa/cibuildwheel from 2.20.0 to 2.21.0 | {
"login": "dependabot[bot]",
"id": 49699333,
"node_id": "MDM6Qm90NDk2OTkzMzM=",
"avatar_url": "https://avatars.githubusercontent.com/in/29110?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/dependabot%5Bbot%5D",
"html_url": "https://github.com/apps/dependabot",
"followers_url": "https://api.github.com/users/dependabot%5Bbot%5D/followers",
"following_url": "https://api.github.com/users/dependabot%5Bbot%5D/following{/other_user}",
"gists_url": "https://api.github.com/users/dependabot%5Bbot%5D/gists{/gist_id}",
"starred_url": "https://api.github.com/users/dependabot%5Bbot%5D/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dependabot%5Bbot%5D/subscriptions",
"organizations_url": "https://api.github.com/users/dependabot%5Bbot%5D/orgs",
"repos_url": "https://api.github.com/users/dependabot%5Bbot%5D/repos",
"events_url": "https://api.github.com/users/dependabot%5Bbot%5D/events{/privacy}",
"received_events_url": "https://api.github.com/users/dependabot%5Bbot%5D/received_events",
"type": "Bot",
"site_admin": false
} | [
{
"id": 129350,
"node_id": "MDU6TGFiZWwxMjkzNTA=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Build",
"name": "Build",
"color": "75507B",
"default": false,
"description": "Library building on various platforms"
},
{
"id": 48070600,
"node_id": "MDU6TGFiZWw0ODA3MDYwMA==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/CI",
"name": "CI",
"color": "a2bca7",
"default": false,
"description": "Continuous Integration"
},
{
"id": 527603109,
"node_id": "MDU6TGFiZWw1Mjc2MDMxMDk=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Dependencies",
"name": "Dependencies",
"color": "d93f0b",
"default": false,
"description": "Required and optional dependencies"
}
] | open | false | null | [] | null | 1 | 2024-09-16T08:33:26 | 2024-09-25T18:42:06 | null | CONTRIBUTOR | null | false | {
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/59816",
"html_url": "https://github.com/pandas-dev/pandas/pull/59816",
"diff_url": "https://github.com/pandas-dev/pandas/pull/59816.diff",
"patch_url": "https://github.com/pandas-dev/pandas/pull/59816.patch",
"merged_at": null
} | Bumps [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel) from 2.20.0 to 2.21.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/pypa/cibuildwheel/releases">pypa/cibuildwheel's releases</a>.</em></p>
<blockquote>
<h2>v2.21.0</h2>
<ul>
<li>⚠️ Update CPython 3.12 to 3.12.6, which changes the macOS minimum deployment target on CPython 3.12 from macOS 10.9 to macOS 10.13 (<a href="https://redirect.github.com/pypa/cibuildwheel/issues/1998">#1998</a>)</li>
<li>🛠 Changes the behaviour when inheriting <code>config-settings</code> in TOML overrides - rather than extending each key, which is rarely useful, individual keys will override previously set values. (<a href="https://redirect.github.com/pypa/cibuildwheel/issues/1803">#1803</a>)</li>
<li>🛠 Update CPython 3.13 to 3.13.0rc2 (<a href="https://redirect.github.com/pypa/cibuildwheel/issues/1998">#1998</a>)</li>
<li>✨ Adds support for multiarch OCI images (<a href="https://redirect.github.com/pypa/cibuildwheel/issues/1961">#1961</a>)</li>
<li>🐛 Fixes some bugs building Linux wheels on macOS. (<a href="https://redirect.github.com/pypa/cibuildwheel/issues/1961">#1961</a>)</li>
<li>⚠️ Changes the minimum version of Docker/Podman to Docker API version 1.43, Podman API version 3. The only mainstream runner this should affect is Travis Graviton2 runners - if so you can <a href="https://redirect.github.com/pypa/cibuildwheel/pull/1961#issuecomment-2304060019">upgrade your version of Docker</a>. (<a href="https://redirect.github.com/pypa/cibuildwheel/issues/1961">#1961</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/pypa/cibuildwheel/blob/main/docs/changelog.md">pypa/cibuildwheel's changelog</a>.</em></p>
<blockquote>
<h3>v2.21.0</h3>
<p><em>13 September 2024</em></p>
<ul>
<li>⚠️ Update CPython 3.12 to 3.12.6, which changes the macOS minimum deployment target on CPython 3.12 from macOS 10.9 to macOS 10.13 (<a href="https://redirect.github.com/pypa/cibuildwheel/issues/1998">#1998</a>)</li>
<li>🛠 Changes the behaviour when inheriting <code>config-settings</code> in TOML overrides - rather than extending each key, which is rarely useful, individual keys will override previously set values. (<a href="https://redirect.github.com/pypa/cibuildwheel/issues/1803">#1803</a>)</li>
<li>🛠 Update CPython 3.13 to 3.13.0rc2 (<a href="https://redirect.github.com/pypa/cibuildwheel/issues/1998">#1998</a>)</li>
<li>✨ Adds support for multiarch OCI images (<a href="https://redirect.github.com/pypa/cibuildwheel/issues/1961">#1961</a>)</li>
<li>🐛 Fixes some bugs building Linux wheels on macOS. (<a href="https://redirect.github.com/pypa/cibuildwheel/issues/1961">#1961</a>)</li>
<li>⚠️ Changes the minimum version of Docker/Podman to Docker API version 1.43, Podman API version 3. The only mainstream runner this should affect is Travis Graviton2 runners - if so you can <a href="https://redirect.github.com/pypa/cibuildwheel/pull/1961#issuecomment-2304060019">upgrade your version of Docker</a>. (<a href="https://redirect.github.com/pypa/cibuildwheel/issues/1961">#1961</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/pypa/cibuildwheel/commit/79b0dd328794e1180a7268444d46cdf12e1abd01"><code>79b0dd3</code></a> Bump version: v2.21.0</li>
<li><a href="https://github.com/pypa/cibuildwheel/commit/0787a44d997310003e5fe4ae52d30517c73606c6"><code>0787a44</code></a> fix: enforce minimum version of docker/podman (<a href="https://redirect.github.com/pypa/cibuildwheel/issues/1961">#1961</a>)</li>
<li><a href="https://github.com/pypa/cibuildwheel/commit/fd11286290a46d09f484ded0a3636655279a5f31"><code>fd11286</code></a> [Bot] Update dependencies (<a href="https://redirect.github.com/pypa/cibuildwheel/issues/1998">#1998</a>)</li>
<li><a href="https://github.com/pypa/cibuildwheel/commit/22dc864d60d0f7ea8d768ffbe0eded598f49452f"><code>22dc864</code></a> [pre-commit.ci] pre-commit autoupdate (<a href="https://redirect.github.com/pypa/cibuildwheel/issues/2000">#2000</a>)</li>
<li><a href="https://github.com/pypa/cibuildwheel/commit/9d2f46ce4e6fdbf13b6fd623cf9f754fb53fa52e"><code>9d2f46c</code></a> chore(deps): bump the actions group with 2 updates (<a href="https://redirect.github.com/pypa/cibuildwheel/issues/1999">#1999</a>)</li>
<li><a href="https://github.com/pypa/cibuildwheel/commit/b1ed7bb3bcf32f107623a93f4ef4409a16e402cc"><code>b1ed7bb</code></a> [Bot] Update dependencies (<a href="https://redirect.github.com/pypa/cibuildwheel/issues/1993">#1993</a>)</li>
<li><a href="https://github.com/pypa/cibuildwheel/commit/ca08f5fbcfa265bd9adddc04a4ba399f56d35ec0"><code>ca08f5f</code></a> Customise merge behaviour depending on option. Fix <a href="https://redirect.github.com/pypa/cibuildwheel/issues/1803">#1803</a> (<a href="https://redirect.github.com/pypa/cibuildwheel/issues/1984">#1984</a>)</li>
<li><a href="https://github.com/pypa/cibuildwheel/commit/229029e1127548104eb1cf537bc6f372833a2791"><code>229029e</code></a> [pre-commit.ci] pre-commit autoupdate (<a href="https://redirect.github.com/pypa/cibuildwheel/issues/1994">#1994</a>)</li>
<li><a href="https://github.com/pypa/cibuildwheel/commit/3294577c175a33c6f24ca310c13f6799d5a40b90"><code>3294577</code></a> [pre-commit.ci] pre-commit autoupdate (<a href="https://redirect.github.com/pypa/cibuildwheel/issues/1987">#1987</a>)</li>
<li><a href="https://github.com/pypa/cibuildwheel/commit/8f51efbc3e4bb081e470c389010af8628fcba4f6"><code>8f51efb</code></a> [Bot] Update dependencies (<a href="https://redirect.github.com/pypa/cibuildwheel/issues/1985">#1985</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/pypa/cibuildwheel/compare/v2.20.0...v2.21.0">compare view</a></li>
</ul>
</details>
<br />
[](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
</details> | null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59816/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59816/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59815 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59815/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59815/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59815/events | https://github.com/pandas-dev/pandas/pull/59815 | 2,527,564,461 | PR_kwDOAA0YD857kvzq | 59,815 | BUG: read_json silently ignores the dtype when engine=pyarrow | {
"login": "jahn96",
"id": 15991814,
"node_id": "MDQ6VXNlcjE1OTkxODE0",
"avatar_url": "https://avatars.githubusercontent.com/u/15991814?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/jahn96",
"html_url": "https://github.com/jahn96",
"followers_url": "https://api.github.com/users/jahn96/followers",
"following_url": "https://api.github.com/users/jahn96/following{/other_user}",
"gists_url": "https://api.github.com/users/jahn96/gists{/gist_id}",
"starred_url": "https://api.github.com/users/jahn96/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jahn96/subscriptions",
"organizations_url": "https://api.github.com/users/jahn96/orgs",
"repos_url": "https://api.github.com/users/jahn96/repos",
"events_url": "https://api.github.com/users/jahn96/events{/privacy}",
"received_events_url": "https://api.github.com/users/jahn96/received_events",
"type": "User",
"site_admin": false
} | [] | open | false | null | [] | null | 0 | 2024-09-16T05:57:44 | 2024-09-30T03:39:28 | null | CONTRIBUTOR | null | false | {
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/59815",
"html_url": "https://github.com/pandas-dev/pandas/pull/59815",
"diff_url": "https://github.com/pandas-dev/pandas/pull/59815.diff",
"patch_url": "https://github.com/pandas-dev/pandas/pull/59815.patch",
"merged_at": null
} | - [x] closes #59516 (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.
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59815/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59815/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59791 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59791/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59791/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59791/events | https://github.com/pandas-dev/pandas/pull/59791 | 2,525,592,165 | PR_kwDOAA0YD857ebml | 59,791 | Fix doc errors for various datetime functions | {
"login": "Pranav-Wadhwa",
"id": 25285598,
"node_id": "MDQ6VXNlcjI1Mjg1NTk4",
"avatar_url": "https://avatars.githubusercontent.com/u/25285598?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Pranav-Wadhwa",
"html_url": "https://github.com/Pranav-Wadhwa",
"followers_url": "https://api.github.com/users/Pranav-Wadhwa/followers",
"following_url": "https://api.github.com/users/Pranav-Wadhwa/following{/other_user}",
"gists_url": "https://api.github.com/users/Pranav-Wadhwa/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Pranav-Wadhwa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Pranav-Wadhwa/subscriptions",
"organizations_url": "https://api.github.com/users/Pranav-Wadhwa/orgs",
"repos_url": "https://api.github.com/users/Pranav-Wadhwa/repos",
"events_url": "https://api.github.com/users/Pranav-Wadhwa/events{/privacy}",
"received_events_url": "https://api.github.com/users/Pranav-Wadhwa/received_events",
"type": "User",
"site_admin": false
} | [] | open | false | null | [] | null | 0 | 2024-09-13T19:59:13 | 2024-09-13T20:22:37 | null | CONTRIBUTOR | null | false | {
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/59791",
"html_url": "https://github.com/pandas-dev/pandas/pull/59791",
"diff_url": "https://github.com/pandas-dev/pandas/pull/59791.diff",
"patch_url": "https://github.com/pandas-dev/pandas/pull/59791.patch",
"merged_at": null
} | - [x] Addresses parts of #59592 | null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59791/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59791/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59788 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59788/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59788/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59788/events | https://github.com/pandas-dev/pandas/issues/59788 | 2,524,468,512 | I_kwDOAA0YD86WeFUg | 59,788 | DOC: Series.update throws a `FutureWarning` about `def[col] = df[col].method` but `.update` returns `None` and works `inplace` | {
"login": "spawn-guy",
"id": 1442562,
"node_id": "MDQ6VXNlcjE0NDI1NjI=",
"avatar_url": "https://avatars.githubusercontent.com/u/1442562?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/spawn-guy",
"html_url": "https://github.com/spawn-guy",
"followers_url": "https://api.github.com/users/spawn-guy/followers",
"following_url": "https://api.github.com/users/spawn-guy/following{/other_user}",
"gists_url": "https://api.github.com/users/spawn-guy/gists{/gist_id}",
"starred_url": "https://api.github.com/users/spawn-guy/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/spawn-guy/subscriptions",
"organizations_url": "https://api.github.com/users/spawn-guy/orgs",
"repos_url": "https://api.github.com/users/spawn-guy/repos",
"events_url": "https://api.github.com/users/spawn-guy/events{/privacy}",
"received_events_url": "https://api.github.com/users/spawn-guy/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 134699,
"node_id": "MDU6TGFiZWwxMzQ2OTk=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Docs",
"name": "Docs",
"color": "3465A4",
"default": false,
"description": null
},
{
"id": 307649777,
"node_id": "MDU6TGFiZWwzMDc2NDk3Nzc=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Needs%20Info",
"name": "Needs Info",
"color": "207de5",
"default": false,
"description": "Clarification about behavior needed to assess issue"
},
{
"id": 2085877452,
"node_id": "MDU6TGFiZWwyMDg1ODc3NDUy",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Copy%20/%20view%20semantics",
"name": "Copy / view semantics",
"color": "70e5ca",
"default": false,
"description": ""
}
] | open | false | null | [] | null | 3 | 2024-09-13T10:16:43 | 2024-09-18T01:26:31 | null | NONE | null | null | null | ### Pandas version checks
- [X] I have checked that the issue still exists on the latest versions of the docs on `main` [here](https://pandas.pydata.org/docs/dev/)
### Location of the documentation
https://pandas.pydata.org/docs/dev/reference/api/pandas.Series.update.html#pandas.Series.update
### Documentation problem
`df.update` resembles how `python.dict.update` works, but `df.update` doesn't support CoW
### Suggested fix for documentation
remove FutureWarning for the `df.update`
or create a (for example) `df.coalesce` method that will, actually, `return` something. this shouldn't brake existing code | null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59788/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59788/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59786 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59786/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59786/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59786/events | https://github.com/pandas-dev/pandas/pull/59786 | 2,523,505,058 | PR_kwDOAA0YD857XR25 | 59,786 | ENH: Follow up to PR #59577, Series.str.get_dummies() raise on str type | {
"login": "aaronchucarroll",
"id": 120818400,
"node_id": "U_kgDOBzOK4A",
"avatar_url": "https://avatars.githubusercontent.com/u/120818400?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/aaronchucarroll",
"html_url": "https://github.com/aaronchucarroll",
"followers_url": "https://api.github.com/users/aaronchucarroll/followers",
"following_url": "https://api.github.com/users/aaronchucarroll/following{/other_user}",
"gists_url": "https://api.github.com/users/aaronchucarroll/gists{/gist_id}",
"starred_url": "https://api.github.com/users/aaronchucarroll/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/aaronchucarroll/subscriptions",
"organizations_url": "https://api.github.com/users/aaronchucarroll/orgs",
"repos_url": "https://api.github.com/users/aaronchucarroll/repos",
"events_url": "https://api.github.com/users/aaronchucarroll/events{/privacy}",
"received_events_url": "https://api.github.com/users/aaronchucarroll/received_events",
"type": "User",
"site_admin": false
} | [] | open | false | null | [] | null | 3 | 2024-09-12T23:05:16 | 2024-10-08T16:06:22 | null | CONTRIBUTOR | null | false | {
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/59786",
"html_url": "https://github.com/pandas-dev/pandas/pull/59786",
"diff_url": "https://github.com/pandas-dev/pandas/pull/59786.diff",
"patch_url": "https://github.com/pandas-dev/pandas/pull/59786.patch",
"merged_at": null
} | - [x] [Tests added and passed]
- [x] All [code checks passed]
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59786/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59786/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59783 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59783/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59783/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59783/events | https://github.com/pandas-dev/pandas/issues/59783 | 2,521,898,420 | I_kwDOAA0YD86WUR20 | 59,783 | DOC: Questions on Usage of *args, **kwargs, and inplace parameters in pandas.Series.cat methods | {
"login": "saldanhad",
"id": 115748404,
"node_id": "U_kgDOBuYuNA",
"avatar_url": "https://avatars.githubusercontent.com/u/115748404?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/saldanhad",
"html_url": "https://github.com/saldanhad",
"followers_url": "https://api.github.com/users/saldanhad/followers",
"following_url": "https://api.github.com/users/saldanhad/following{/other_user}",
"gists_url": "https://api.github.com/users/saldanhad/gists{/gist_id}",
"starred_url": "https://api.github.com/users/saldanhad/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/saldanhad/subscriptions",
"organizations_url": "https://api.github.com/users/saldanhad/orgs",
"repos_url": "https://api.github.com/users/saldanhad/repos",
"events_url": "https://api.github.com/users/saldanhad/events{/privacy}",
"received_events_url": "https://api.github.com/users/saldanhad/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 134699,
"node_id": "MDU6TGFiZWwxMzQ2OTk=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Docs",
"name": "Docs",
"color": "3465A4",
"default": false,
"description": null
},
{
"id": 5783272581,
"node_id": "LA_kwDOAA0YD88AAAABWLW8hQ",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Accessors",
"name": "Accessors",
"color": "d93f0b",
"default": false,
"description": "accessor registration mechanism (not .str, .dt, .cat)"
}
] | open | false | {
"login": "saldanhad",
"id": 115748404,
"node_id": "U_kgDOBuYuNA",
"avatar_url": "https://avatars.githubusercontent.com/u/115748404?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/saldanhad",
"html_url": "https://github.com/saldanhad",
"followers_url": "https://api.github.com/users/saldanhad/followers",
"following_url": "https://api.github.com/users/saldanhad/following{/other_user}",
"gists_url": "https://api.github.com/users/saldanhad/gists{/gist_id}",
"starred_url": "https://api.github.com/users/saldanhad/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/saldanhad/subscriptions",
"organizations_url": "https://api.github.com/users/saldanhad/orgs",
"repos_url": "https://api.github.com/users/saldanhad/repos",
"events_url": "https://api.github.com/users/saldanhad/events{/privacy}",
"received_events_url": "https://api.github.com/users/saldanhad/received_events",
"type": "User",
"site_admin": false
} | [
{
"login": "saldanhad",
"id": 115748404,
"node_id": "U_kgDOBuYuNA",
"avatar_url": "https://avatars.githubusercontent.com/u/115748404?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/saldanhad",
"html_url": "https://github.com/saldanhad",
"followers_url": "https://api.github.com/users/saldanhad/followers",
"following_url": "https://api.github.com/users/saldanhad/following{/other_user}",
"gists_url": "https://api.github.com/users/saldanhad/gists{/gist_id}",
"starred_url": "https://api.github.com/users/saldanhad/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/saldanhad/subscriptions",
"organizations_url": "https://api.github.com/users/saldanhad/orgs",
"repos_url": "https://api.github.com/users/saldanhad/repos",
"events_url": "https://api.github.com/users/saldanhad/events{/privacy}",
"received_events_url": "https://api.github.com/users/saldanhad/received_events",
"type": "User",
"site_admin": false
}
] | null | 2 | 2024-09-12T09:46:33 | 2024-09-20T15:20:21 | null | CONTRIBUTOR | null | null | null | ### Pandas version checks
- [X] I have checked that the issue still exists on the latest versions of the docs on `main` [here](https://pandas.pydata.org/docs/dev/)
### Location of the documentation
https://pandas.pydata.org/docs/reference/api/pandas.Series.cat.remove_categories.html#pandas.Series.cat.remove_categories
https://pandas.pydata.org/docs/reference/api/pandas.Series.cat.rename_categories.html#pandas.Series.cat.rename_categories
### Documentation problem
I am currently trying to work on the issue #59592, specifically for the remove_categories and rename_categories methods. Before finalizing my changes, I need some clarification on a few points regarding the documentation:
1. `*args` and `**kwargs` Usage:
- For remove_categories, the method only seems to use the removals parameter.
- Similarly, for rename_categories, `*args` and `**kwargs` are mentioned but not utilized in the method implementation. Could you clarify whether the inclusion of `*args` and `**kwargs` in the documentation for methods is by design?
- I have noticed this pattern across many methods and wanted to confirm if this is intentional or if the documentation should be updated to reflect actual usage.
2. `inplace` Parameter: The `inplace` parameter for methods is included in the error codes of the validation docstring. However, it is not explicitly mentioned in the current documentation, nor is it included as part of the method definition for both methods.
### Suggested fix for documentation
Verify usage of ` **args`, `**kwargs`, and 'inplace' if not make changes to the `pandas.Series.cat` methods in docs. | null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59783/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59783/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59780 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59780/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59780/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59780/events | https://github.com/pandas-dev/pandas/issues/59780 | 2,519,800,865 | I_kwDOAA0YD86WMRwh | 59,780 | Consider moving pyarrow's pandas compatibility and conversion code to the pandas project? | {
"login": "jorisvandenbossche",
"id": 1020496,
"node_id": "MDQ6VXNlcjEwMjA0OTY=",
"avatar_url": "https://avatars.githubusercontent.com/u/1020496?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/jorisvandenbossche",
"html_url": "https://github.com/jorisvandenbossche",
"followers_url": "https://api.github.com/users/jorisvandenbossche/followers",
"following_url": "https://api.github.com/users/jorisvandenbossche/following{/other_user}",
"gists_url": "https://api.github.com/users/jorisvandenbossche/gists{/gist_id}",
"starred_url": "https://api.github.com/users/jorisvandenbossche/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jorisvandenbossche/subscriptions",
"organizations_url": "https://api.github.com/users/jorisvandenbossche/orgs",
"repos_url": "https://api.github.com/users/jorisvandenbossche/repos",
"events_url": "https://api.github.com/users/jorisvandenbossche/events{/privacy}",
"received_events_url": "https://api.github.com/users/jorisvandenbossche/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 219960758,
"node_id": "MDU6TGFiZWwyMTk5NjA3NTg=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Needs%20Discussion",
"name": "Needs Discussion",
"color": "207de5",
"default": false,
"description": "Requires discussion from core team before further action"
},
{
"id": 3303158446,
"node_id": "MDU6TGFiZWwzMzAzMTU4NDQ2",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Arrow",
"name": "Arrow",
"color": "f9d0c4",
"default": false,
"description": "pyarrow functionality"
}
] | open | false | null | [] | null | 1 | 2024-09-11T13:45:51 | 2024-09-11T13:52:09 | null | MEMBER | null | null | null | This issue is to discuss the idea of moving a significant part of the pandas conversion and compatibility code that currently lives in `pyarrow` to the pandas project itself. Of course we would keep all low-level conversions (e.g. everything that lives in pyarrow C++) at the array-level in pyarrow itself (i.e. what pandas would use), but I think that a large part of what lives in [`pyarrow/pandas_compat.py`](https://github.com/apache/arrow/blob/apache-arrow-17.0.0/python/pyarrow/pandas_compat.py) could live in pandas.
Some reasons to do this:
- It's a lot of pandas specific code that might "fit" better in pandas itself
- It would allow pandas to control the conversion more tightly
- Example: now with upcoming pandas 3.0 and the new string dtype, pandas could ensure to use that new dtype in any conversion, while now with older versions of pyarrow `to_pandas()` will still give object dtype (https://github.com/apache/arrow/issues/43683)
- The required low-level functionality in pyarrow should now also be stable enough to allow having this code live in pandas itself (which might not have been the case at the inception of pyarrow)
A potential downside is that it makes the dependency structure even more complex (pyarrow's `to_pandas()` relying on pandas relying on pyarrow), although pyarrow already has infrastructure set up to lazily import pandas today.
The idea is not that we would change any public pyarrow API that supports pandas (ingesting pandas in various pyarrow constructors, `to_pandas()` methods on objects, etc), but that at least for the DataFrame and Series level, pyarrow would under the hood rely on a method from pandas to do that conversion.
For example, I think that most of the handling of the "pandas metadata" (to guarantee a better pandas <-> arrow roundtrip) could live in pandas itself, or the code to convert column labels to strings and reconstruct an Index in the other direction, determining which columns should be converted as an extension dtype vs numpy dtype, etc
There are of course a lot of details to figure out, but wanted to already open the issue to get a general idea of what people think about this, and if we want to maintain this in pandas.
Equivalent issue on the pyarrow side: https://github.com/apache/arrow/issues/44068
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59780/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59780/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59777 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59777/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59777/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59777/events | https://github.com/pandas-dev/pandas/issues/59777 | 2,519,611,796 | I_kwDOAA0YD86WLjmU | 59,777 | ENH: Add a clear option to interpret strings as Pandas dtypes specifically. | {
"login": "vitkosbence",
"id": 61665318,
"node_id": "MDQ6VXNlcjYxNjY1MzE4",
"avatar_url": "https://avatars.githubusercontent.com/u/61665318?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/vitkosbence",
"html_url": "https://github.com/vitkosbence",
"followers_url": "https://api.github.com/users/vitkosbence/followers",
"following_url": "https://api.github.com/users/vitkosbence/following{/other_user}",
"gists_url": "https://api.github.com/users/vitkosbence/gists{/gist_id}",
"starred_url": "https://api.github.com/users/vitkosbence/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/vitkosbence/subscriptions",
"organizations_url": "https://api.github.com/users/vitkosbence/orgs",
"repos_url": "https://api.github.com/users/vitkosbence/repos",
"events_url": "https://api.github.com/users/vitkosbence/events{/privacy}",
"received_events_url": "https://api.github.com/users/vitkosbence/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 76812,
"node_id": "MDU6TGFiZWw3NjgxMg==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Enhancement",
"name": "Enhancement",
"color": "4E9A06",
"default": false,
"description": null
},
{
"id": 49254273,
"node_id": "MDU6TGFiZWw0OTI1NDI3Mw==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/IO%20Excel",
"name": "IO Excel",
"color": "bfe5bf",
"default": false,
"description": "read_excel, to_excel"
},
{
"id": 57522093,
"node_id": "MDU6TGFiZWw1NzUyMjA5Mw==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Strings",
"name": "Strings",
"color": "5319e7",
"default": false,
"description": "String extension data type and string data"
},
{
"id": 307649777,
"node_id": "MDU6TGFiZWwzMDc2NDk3Nzc=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Needs%20Info",
"name": "Needs Info",
"color": "207de5",
"default": false,
"description": "Clarification about behavior needed to assess issue"
}
] | open | false | null | [] | null | 1 | 2024-09-11T12:27:43 | 2024-09-12T20:35:34 | null | NONE | null | null | null | ### Feature Type
- [X] Adding new functionality to pandas
- [ ] Changing existing functionality in pandas
- [ ] Removing existing functionality in pandas
### Problem Description
When the pd.read_excel function encounters an empty cell with a numeric dtype, it leads to a conversion error. The solution to this, is to use the Pandas specific nullable numeric types, which work extremely well. The problem is that these datatypes are hard to access via strings. pd.read_excel is especially keen on interpreting strings as numpy datatypes, while pd.api.types.pandas_dtype is capable of returning pandas dtypes, but it's unclear what this is based on.
### Feature Description
Since the pandas dtypes often have several advantages over their numpy counterparts, it would make sense that functions which are capable of interpreting strings as datatypes have a flag, which forces them (if possible) to interpret strings as pandas datatypes and not their numpy counterparts.
### Alternative Solutions
A workaround for now, is to run every datatype through the pd.api.types.pandas_dtype function, with very specific capitalization.
Running:
type(pd.api.types.pandas_dtype("Int64"))
Returns:
<class 'pandas.core.arrays.integer.Int64Dtype'>
Which is good, but running:
type(pd.api.types.pandas_dtype("int64"))
Returns:
<class 'numpy.dtypes.Int64DType'>
So while this is technically a solution, trying to use the pandas interpreter for input from a user who doesn't have intricate knowledge of the issue is not possible.
### Additional Context
_No response_ | null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59777/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59777/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59775 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59775/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59775/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59775/events | https://github.com/pandas-dev/pandas/issues/59775 | 2,518,250,914 | I_kwDOAA0YD86WGXWi | 59,775 | BUG: pd.concat() cannot concatenate more than 3 mixed-frequency dataframes with multi-index series | {
"login": "sakaiando",
"id": 43052833,
"node_id": "MDQ6VXNlcjQzMDUyODMz",
"avatar_url": "https://avatars.githubusercontent.com/u/43052833?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/sakaiando",
"html_url": "https://github.com/sakaiando",
"followers_url": "https://api.github.com/users/sakaiando/followers",
"following_url": "https://api.github.com/users/sakaiando/following{/other_user}",
"gists_url": "https://api.github.com/users/sakaiando/gists{/gist_id}",
"starred_url": "https://api.github.com/users/sakaiando/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sakaiando/subscriptions",
"organizations_url": "https://api.github.com/users/sakaiando/orgs",
"repos_url": "https://api.github.com/users/sakaiando/repos",
"events_url": "https://api.github.com/users/sakaiando/events{/privacy}",
"received_events_url": "https://api.github.com/users/sakaiando/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 76811,
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug",
"name": "Bug",
"color": "e10c02",
"default": false,
"description": null
},
{
"id": 13098779,
"node_id": "MDU6TGFiZWwxMzA5ODc3OQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Reshaping",
"name": "Reshaping",
"color": "02d7e1",
"default": false,
"description": "Concat, Merge/Join, Stack/Unstack, Explode"
},
{
"id": 60635328,
"node_id": "MDU6TGFiZWw2MDYzNTMyOA==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Period",
"name": "Period",
"color": "eb6420",
"default": false,
"description": "Period data type"
},
{
"id": 219960758,
"node_id": "MDU6TGFiZWwyMTk5NjA3NTg=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Needs%20Discussion",
"name": "Needs Discussion",
"color": "207de5",
"default": false,
"description": "Requires discussion from core team before further action"
}
] | open | false | null | [] | null | 1 | 2024-09-11T01:18:10 | 2024-09-14T14:41:04 | null | NONE | null | null | null | ### Pandas version checks
- [X] I have checked that this issue has not already been reported.
- [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas.
- [X] I have confirmed this bug exists on the [main branch](https://pandas.pydata.org/docs/dev/getting_started/install.html#installing-the-development-version-of-pandas) of pandas.
### Reproducible Example
```python
n = 5
p = 2
dfA = pd.DataFrame(np.random.rand(n,p),
columns=['A0','B0'],
index=pd.period_range(start='2000-1-1',periods=n,freq='Y'))
dfQ = pd.DataFrame(np.random.rand(n,p),
columns=['A0','B0'],
index=pd.period_range(start='2000-1-1',periods=n,freq='Q'))
dfM = pd.DataFrame(np.random.rand(n,p),
columns=['A0','B0'],
index=pd.period_range(start='2000-1-1',periods=n,freq='M'))
df1 = dfA.loc[:,['A0']].T.stack()
df2 = dfA.loc[:,['B0']].T.stack()
df3 = dfQ.loc[:,['A0']].T.stack()
df4 = dfQ.loc[:,['B0']].T.stack()
df5 = dfM.loc[:,['A0']].T.stack()
df6 = dfM.loc[:,['B0']].T.stack()
# these work
pd.concat([df1,df4])
pd.concat([df1,df2])
pd.concat([df1,df3])
pd.concat([df1,df2,df3])
pd.concat([dfA['A0'],dfQ['A0'],dfM['A0']])
# error
pd.concat([df1,df3,df2])
pd.concat([df1,df2,df3,df4])
pd.concat([df1,df3,df5])
```
### Issue Description
pd.concat() can concatenate 3 multi-index dataframes when they have 2 frequencies, but cannot concatenate 4 dataframes.
### Expected Behavior
pd.concat() should be able to concatenate a list of mixed-freq multiindex dataframes no matter how many items the list has.
### Installed Versions
<details>
INSTALLED VERSIONS
------------------
commit : d9cdd2ee5a58015ef6f4d15c7226110c9aab8140
python : 3.12.4.final.0
python-bits : 64
OS : Windows
OS-release : 2016Server
Version : 10.0.14393
machine : AMD64
processor : Intel64 Family 6 Model 85 Stepping 4, GenuineIntel
byteorder : little
LC_ALL : None
LANG : en
LOCALE : English_United States.1252
pandas : 2.2.2
numpy : 1.26.4
pytz : 2024.1
dateutil : 2.9.0.post0
setuptools : 72.1.0
pip : 24.0
Cython : 3.0.11
pytest : None
hypothesis : None
sphinx : 8.0.2
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 3.1.4
IPython : 8.26.0
pandas_datareader : None
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : 4.12.3
bottleneck : None
dataframe-api-compat : None
fastparquet : None
fsspec : 2024.6.1
gcsfs : None
matplotlib : 3.9.1.post1
numba : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : 17.0.0
pyreadstat : None
python-calamine : None
pyxlsb : None
s3fs : None
scipy : 1.14.0
sqlalchemy : None
tables : None
tabulate : 0.9.0
xarray : None
xlrd : None
zstandard : None
tzdata : 2024.1
qtpy : 2.4.1
pyqt5 : None
</details>
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59775/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59775/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59772 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59772/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59772/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59772/events | https://github.com/pandas-dev/pandas/issues/59772 | 2,517,073,210 | I_kwDOAA0YD86WB306 | 59,772 | BUG: tz-aware series with NaT raises exception on .to_numpy("datetime64") | {
"login": "Ranfir",
"id": 58370848,
"node_id": "MDQ6VXNlcjU4MzcwODQ4",
"avatar_url": "https://avatars.githubusercontent.com/u/58370848?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Ranfir",
"html_url": "https://github.com/Ranfir",
"followers_url": "https://api.github.com/users/Ranfir/followers",
"following_url": "https://api.github.com/users/Ranfir/following{/other_user}",
"gists_url": "https://api.github.com/users/Ranfir/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Ranfir/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Ranfir/subscriptions",
"organizations_url": "https://api.github.com/users/Ranfir/orgs",
"repos_url": "https://api.github.com/users/Ranfir/repos",
"events_url": "https://api.github.com/users/Ranfir/events{/privacy}",
"received_events_url": "https://api.github.com/users/Ranfir/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 76811,
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug",
"name": "Bug",
"color": "e10c02",
"default": false,
"description": null
},
{
"id": 60458168,
"node_id": "MDU6TGFiZWw2MDQ1ODE2OA==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Timezones",
"name": "Timezones",
"color": "5319e7",
"default": false,
"description": "Timezone data dtype"
}
] | open | false | null | [] | null | 2 | 2024-09-10T17:22:37 | 2024-09-30T21:05:14 | null | NONE | null | null | null | ### Pandas version checks
- [X] I have checked that this issue has not already been reported.
- [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas.
- [X] I have confirmed this bug exists on the [main branch](https://pandas.pydata.org/docs/dev/getting_started/install.html#installing-the-development-version-of-pandas) of pandas.
### Reproducible Example
```python
import pandas as pd
pd.Series(pd.NaT).dt.tz_localize("UTC").to_numpy("datetime64")
> TypeError: 'float' object cannot be interpreted as an integer
```
### Issue Description
tz-aware series with `NaT` raises exception on `.to_numpy("datetime64")`
### Expected Behavior
Expect same behavior as a tz-naive series, e.g.
```python
pd.Series(pd.NaT).to_numpy("datetime64")
```
> numpy.datetime64('NaT')
### Installed Versions
<details>
INSTALLED VERSIONS
------------------
commit : d9cdd2ee5a58015ef6f4d15c7226110c9aab8140
python : 3.11.6.final.0
python-bits : 64
OS : Linux
OS-release : 5.10.0-29-cloud-amd64
Version : #1 SMP Debian 5.10.216-1 (2024-05-03)
machine : x86_64
processor :
byteorder : little
LC_ALL : None
LANG : C.UTF-8
LOCALE : en_US.UTF-8
pandas : 2.2.2
numpy : 1.26.4
pytz : 2022.7.1
dateutil : 2.9.0.post0
setuptools : 69.2.0
pip : 24.0
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 3.1.4
IPython : 8.23.0
pandas_datareader : None
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : None
bottleneck : None
dataframe-api-compat : None
fastparquet : None
fsspec : 2024.6.1
gcsfs : 2024.6.1
matplotlib : 3.9.0
numba : 0.58.1
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : 14.0.2
pyreadstat : None
python-calamine : None
pyxlsb : None
s3fs : None
scipy : 1.13.1
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
zstandard : None
tzdata : 2024.1
qtpy : None
pyqt5 : None
</details>
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59772/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59772/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59771 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59771/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59771/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59771/events | https://github.com/pandas-dev/pandas/issues/59771 | 2,516,226,966 | I_kwDOAA0YD86V-pOW | 59,771 | ENH: ArrowTemporalProperties' object has no attribute 'to_period' | {
"login": "dbalabka",
"id": 1269372,
"node_id": "MDQ6VXNlcjEyNjkzNzI=",
"avatar_url": "https://avatars.githubusercontent.com/u/1269372?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/dbalabka",
"html_url": "https://github.com/dbalabka",
"followers_url": "https://api.github.com/users/dbalabka/followers",
"following_url": "https://api.github.com/users/dbalabka/following{/other_user}",
"gists_url": "https://api.github.com/users/dbalabka/gists{/gist_id}",
"starred_url": "https://api.github.com/users/dbalabka/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dbalabka/subscriptions",
"organizations_url": "https://api.github.com/users/dbalabka/orgs",
"repos_url": "https://api.github.com/users/dbalabka/repos",
"events_url": "https://api.github.com/users/dbalabka/events{/privacy}",
"received_events_url": "https://api.github.com/users/dbalabka/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 76812,
"node_id": "MDU6TGFiZWw3NjgxMg==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Enhancement",
"name": "Enhancement",
"color": "4E9A06",
"default": false,
"description": null
},
{
"id": 211840,
"node_id": "MDU6TGFiZWwyMTE4NDA=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Datetime",
"name": "Datetime",
"color": "AFEEEE",
"default": false,
"description": "Datetime data dtype"
},
{
"id": 219960758,
"node_id": "MDU6TGFiZWwyMTk5NjA3NTg=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Needs%20Discussion",
"name": "Needs Discussion",
"color": "207de5",
"default": false,
"description": "Requires discussion from core team before further action"
},
{
"id": 3303158446,
"node_id": "MDU6TGFiZWwzMzAzMTU4NDQ2",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Arrow",
"name": "Arrow",
"color": "f9d0c4",
"default": false,
"description": "pyarrow functionality"
}
] | open | false | null | [] | null | 4 | 2024-09-10T11:53:22 | 2024-10-01T01:11:43 | null | NONE | null | null | null | ### Feature Type
- [X] Adding new functionality to pandas
- [ ] Changing existing functionality in pandas
- [ ] Removing existing functionality in pandas
### Problem Description
This request is related to #52321 and #52330. Currently, Arrow dtype does not support function: https://pandas.pydata.org/docs/reference/api/pandas.Series.to_period.html
### Feature Description
The following script throws an error:
```python
import pandas as pd
from datetime import datetime
s = pd.Series([datetime.now()], dtype='date32[pyarrow]')
s.dt.to_period('D')
```
```
AttributeError: 'ArrowTemporalProperties' object has no attribute 'to_period'
```
### Alternative Solutions
Otherwise, it requires convert arrow type back to pandas type which is not efficient:
```
import pandas as pd
from datetime import datetime
s = pd.Series([datetime.now()], dtype='date32[pyarrow]')
pd.to_datetime(s).dt.to_period('D')
```
### Additional Context
_No response_ | null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59771/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59771/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59769 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59769/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59769/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59769/events | https://github.com/pandas-dev/pandas/issues/59769 | 2,515,727,923 | I_kwDOAA0YD86V8vYz | 59,769 | BUG: to_datetime raises "AttributeError: 'NoneType' object has no attribute 'total_seconds'" even with errors='coerce' | {
"login": "enemyleft",
"id": 16655087,
"node_id": "MDQ6VXNlcjE2NjU1MDg3",
"avatar_url": "https://avatars.githubusercontent.com/u/16655087?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/enemyleft",
"html_url": "https://github.com/enemyleft",
"followers_url": "https://api.github.com/users/enemyleft/followers",
"following_url": "https://api.github.com/users/enemyleft/following{/other_user}",
"gists_url": "https://api.github.com/users/enemyleft/gists{/gist_id}",
"starred_url": "https://api.github.com/users/enemyleft/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/enemyleft/subscriptions",
"organizations_url": "https://api.github.com/users/enemyleft/orgs",
"repos_url": "https://api.github.com/users/enemyleft/repos",
"events_url": "https://api.github.com/users/enemyleft/events{/privacy}",
"received_events_url": "https://api.github.com/users/enemyleft/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 76811,
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug",
"name": "Bug",
"color": "e10c02",
"default": false,
"description": null
},
{
"id": 211840,
"node_id": "MDU6TGFiZWwyMTE4NDA=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Datetime",
"name": "Datetime",
"color": "AFEEEE",
"default": false,
"description": "Datetime data dtype"
}
] | open | false | null | [] | null | 4 | 2024-09-10T08:11:55 | 2024-09-25T22:06:36 | null | NONE | null | null | null | ### Pandas version checks
- [X] I have checked that this issue has not already been reported.
- [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas.
- [ ] I have confirmed this bug exists on the [main branch](https://pandas.pydata.org/docs/dev/getting_started/install.html#installing-the-development-version-of-pandas) of pandas.
### Reproducible Example
```python
import pandas as pd
# next line OK
date = pd.to_datetime("Wed, 1 Dec 2021 08:00:00 -0600 (CST)", errors='coerce', utc=True, format='mixed')
# next line raises Exception -> AttributeError: 'NoneType' object has no attribute 'total_seconds'
date = pd.to_datetime("Sun, 14 Apr 2024 20:00:00 +0200 (CET)", errors='coerce', utc=True, format='mixed')
```
### Issue Description
I have many dates to parse, some have a TimeZone like "(CET)", "(CST)" and much others, some not. The format is not predictable, so I cannot pass a predefined format string. The shown examples may be similar here, but this is not the case in real life. After some hours of analysis I finally found one specific date, which actually raises an exception.
`Sun, 14 Apr 2024 20:00:00 +0200 (CET)`
### Expected Behavior
First I would expect that with `errors='coerce'` no error will be raised even the format is completely wrong, it should instead return "NaT", as the documentation suggests.
Second to me there is no "big" difference between the working date string `Wed, 1 Dec 2021 08:00:00 -0600 (CST)` and the one that raises an error `Sun, 14 Apr 2024 20:00:00 +0200 (CET)`. I.e. both have the same format, the biggest difference is the TimeZone abbreviation, which is present in both cases, but different. In fact, if I omit `(CET)`, the string can be parsed correctly.
As a workaround I could manually check whether a TimeZone abbreviation is present and remove it prior to call `to_datetime`. Especially when the time offset is present as well, this information is kind of redundant, i.e. it should not even be of interest for `to_datetime`. But this workaround should not be necessary in my opinion, as I think this is a bug and should be resolved in "to_datetime".
_See also a similar issue here: https://github.com/pandas-dev/pandas/issues/54479. Although I cannot reproduce this in my environment._
### Installed Versions
<details>
INSTALLED VERSIONS
------------------
commit : d9cdd2ee5a58015ef6f4d15c7226110c9aab8140
python : 3.12.5.final.0
python-bits : 64
OS : Linux
OS-release : 6.10.7-arch1-1
Version : #1 SMP PREEMPT_DYNAMIC Thu, 29 Aug 2024 16:48:57 +0000
machine : x86_64
processor :
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 2.2.2
numpy : 2.1.1
pytz : 2024.1
dateutil : 2.9.0.post0
setuptools : None
pip : 24.2
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : None
IPython : None
pandas_datareader : None
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : None
bottleneck : None
dataframe-api-compat : None
fastparquet : None
fsspec : None
gcsfs : None
matplotlib : None
numba : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pyreadstat : None
python-calamine : None
pyxlsb : None
s3fs : None
scipy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
zstandard : None
tzdata : None
qtpy : None
pyqt5 : None
</details>
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59769/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59769/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59767 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59767/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59767/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59767/events | https://github.com/pandas-dev/pandas/pull/59767 | 2,514,814,925 | PR_kwDOAA0YD8565cG9 | 59,767 | Infer extensiondtype from scalar | {
"login": "andrewgsavage",
"id": 13157776,
"node_id": "MDQ6VXNlcjEzMTU3Nzc2",
"avatar_url": "https://avatars.githubusercontent.com/u/13157776?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/andrewgsavage",
"html_url": "https://github.com/andrewgsavage",
"followers_url": "https://api.github.com/users/andrewgsavage/followers",
"following_url": "https://api.github.com/users/andrewgsavage/following{/other_user}",
"gists_url": "https://api.github.com/users/andrewgsavage/gists{/gist_id}",
"starred_url": "https://api.github.com/users/andrewgsavage/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/andrewgsavage/subscriptions",
"organizations_url": "https://api.github.com/users/andrewgsavage/orgs",
"repos_url": "https://api.github.com/users/andrewgsavage/repos",
"events_url": "https://api.github.com/users/andrewgsavage/events{/privacy}",
"received_events_url": "https://api.github.com/users/andrewgsavage/received_events",
"type": "User",
"site_admin": false
} | [] | open | false | null | [] | null | 0 | 2024-09-09T20:05:47 | 2024-09-09T20:05:47 | null | NONE | null | false | {
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/59767",
"html_url": "https://github.com/pandas-dev/pandas/pull/59767",
"diff_url": "https://github.com/pandas-dev/pandas/pull/59767.diff",
"patch_url": "https://github.com/pandas-dev/pandas/pull/59767.patch",
"merged_at": null
} | - [ ] closes #41848
- [ ] [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.
This adds an `is_unambiguous_scalar` (as suggested) method to `ExtensionDtype` that can be used to infer the dtype when it isn't passed into `Series` or `DataFrame` constructors.
With these changes `Series()` can recognise `pint.Quantity`s and construct a `PintArray`. Is this a good approch? I've not done any inference in sanitize_array as its docstring doesn't mention inference. However it looks like it'd be easier to do so in there than do so in the various constructor methods. | null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59767/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59767/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59766 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59766/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59766/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59766/events | https://github.com/pandas-dev/pandas/pull/59766 | 2,514,718,357 | PR_kwDOAA0YD8565HWj | 59,766 | Fix issue #47101 | {
"login": "tigerhawkvok",
"id": 165937,
"node_id": "MDQ6VXNlcjE2NTkzNw==",
"avatar_url": "https://avatars.githubusercontent.com/u/165937?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/tigerhawkvok",
"html_url": "https://github.com/tigerhawkvok",
"followers_url": "https://api.github.com/users/tigerhawkvok/followers",
"following_url": "https://api.github.com/users/tigerhawkvok/following{/other_user}",
"gists_url": "https://api.github.com/users/tigerhawkvok/gists{/gist_id}",
"starred_url": "https://api.github.com/users/tigerhawkvok/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/tigerhawkvok/subscriptions",
"organizations_url": "https://api.github.com/users/tigerhawkvok/orgs",
"repos_url": "https://api.github.com/users/tigerhawkvok/repos",
"events_url": "https://api.github.com/users/tigerhawkvok/events{/privacy}",
"received_events_url": "https://api.github.com/users/tigerhawkvok/received_events",
"type": "User",
"site_admin": false
} | [] | open | false | null | [] | null | 0 | 2024-09-09T19:12:56 | 2024-09-09T20:33:50 | null | NONE | null | false | {
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/59766",
"html_url": "https://github.com/pandas-dev/pandas/pull/59766",
"diff_url": "https://github.com/pandas-dev/pandas/pull/59766.diff",
"patch_url": "https://github.com/pandas-dev/pandas/pull/59766.patch",
"merged_at": null
} | Reapplies PR #59492
See https://github.com/pandas-dev/pandas/pull/59492#issuecomment-2338729574
--------------
Bisecting two years ago ( https://github.com/pandas-dev/pandas/issues/47101#issuecomment-1139606268 ) shows this regression was introduced in b2d54d9 in 2021. Somehow this hasn't been patched since then.
PR #48313 was supposed to address this, but the PR was closed and never merged and the bug has persisted.
Patch takes two tracks -- it first replaces the `arr == x` with [`np.equals()`](https://numpy.org/doc/1.26/reference/generated/numpy.equal.html) which will handle broadcasting in most cases by itself. For the remainder of cases, an explicit type check is done to return an array for the mask.
- [x] closes #47101
- [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).
- [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.
----------------
Has a KNOWN test failure of
> ```
> ruff-format.............................................................................................Failed
> - hook id: ruff-format
> - files were modified by this hook
> ```
but I honestly have no clue what's failing in that. Some inscrutable and poorly reported style problem? | null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59766/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59766/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59765 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59765/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59765/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59765/events | https://github.com/pandas-dev/pandas/issues/59765 | 2,514,692,213 | I_kwDOAA0YD86V4yh1 | 59,765 | API: handling of missing values in Index.__contains__ | {
"login": "jorisvandenbossche",
"id": 1020496,
"node_id": "MDQ6VXNlcjEwMjA0OTY=",
"avatar_url": "https://avatars.githubusercontent.com/u/1020496?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/jorisvandenbossche",
"html_url": "https://github.com/jorisvandenbossche",
"followers_url": "https://api.github.com/users/jorisvandenbossche/followers",
"following_url": "https://api.github.com/users/jorisvandenbossche/following{/other_user}",
"gists_url": "https://api.github.com/users/jorisvandenbossche/gists{/gist_id}",
"starred_url": "https://api.github.com/users/jorisvandenbossche/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jorisvandenbossche/subscriptions",
"organizations_url": "https://api.github.com/users/jorisvandenbossche/orgs",
"repos_url": "https://api.github.com/users/jorisvandenbossche/repos",
"events_url": "https://api.github.com/users/jorisvandenbossche/events{/privacy}",
"received_events_url": "https://api.github.com/users/jorisvandenbossche/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 2822342,
"node_id": "MDU6TGFiZWwyODIyMzQy",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Missing-data",
"name": "Missing-data",
"color": "d7e102",
"default": false,
"description": "np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate"
},
{
"id": 1218227310,
"node_id": "MDU6TGFiZWwxMjE4MjI3MzEw",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Index",
"name": "Index",
"color": "e99695",
"default": false,
"description": "Related to the Index class or subclasses"
},
{
"id": 1741841389,
"node_id": "MDU6TGFiZWwxNzQxODQxMzg5",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/API%20-%20Consistency",
"name": "API - Consistency",
"color": "b60205",
"default": false,
"description": "Internal Consistency of API/Behavior"
}
] | open | false | null | [] | null | 2 | 2024-09-09T18:58:55 | 2024-09-10T07:41:41 | null | MEMBER | null | null | null | The below table gives an overview of the result value for:
```
missing_value in idx
```
i.e. how `Index.__contains__` handles various missing value sentinels as input for the different data types.
| dtype | None | nan | \<NA\> | NaT |
|:---------------|:-------|:------|:-------|:------|
| object-none | True | False | False | False |
| object-nan | False | True | False | False |
| object-NA | False | False | True | False |
| datetime | True | True | True | True |
| period | True | True | True | True |
| timedelta | True | True | True | True |
| float64 | False | True | False | False |
| categorical | True | True | True | True |
| interval | True | True | True | False |
| nullable_int | False | False | True | False |
| nullable_float | False | False | True | False |
| string-python | False | False | False | False |
| string-pyarrow | False | False | False | False |
| str-python | False | False | False | False |
The last three rows with not a single True are specifically problematic, this seems a bug with the StringDtype
But more in general, this is quite inconsistent:
- For object dtype, we require exact match
- For datetimelike and categorical, we match any missing-like
- For interval, we match any missing-like except NaT (also not in case of datetimelike interval dtype)
- For float we only match NaN
- For nullable dtypes (int/float), we only match NA
The code to generate the table above:
<details>
```python
import numpy as np
import pandas as pd
# from conftest.py
indices_dict = {
"object-none": pd.Index(["a", None], dtype=object),
"object-nan": pd.Index(["a", np.nan], dtype=object),
"object-NA": pd.Index(["a", pd.NA], dtype=object),
"datetime": pd.DatetimeIndex(["2024-01-01", "NaT"]),
"period": pd.PeriodIndex(["2024-01-01", None], freq="D"),
"timedelta": pd.TimedeltaIndex(["1 days", "NaT"]),
"float64": pd.Index([2.0, np.nan], dtype="float64"),
"categorical": pd.CategoricalIndex(["a", None]),
"interval": pd.IntervalIndex.from_tuples([(1, 2), np.nan]),
"nullable_int": pd.Index([2, None], dtype="Int64"),
"nullable_float": pd.Index([2.0, None], dtype="Float32"),
"string-python": pd.Index(["a", None], dtype="string[python]"),
"string-pyarrow": pd.Index(["a", None], dtype="string[pyarrow]"),
"str-python": pd.Index(["a", None], dtype=pd.StringDtype("pyarrow", na_value=np.nan))
}
results = []
for dtype, data in indices_dict.items():
for val in [None, np.nan, pd.NA, pd.NaT]:
res = val in data
results.append((dtype, str(val), res))
df = pd.DataFrame(results, columns=["dtype", "val", "result"])
df_overview = df.pivot(columns="val", index="dtype", values="result").reindex(columns=df["val"].unique(), index=df["dtype"].unique())
print(df_overview.astype(str).to_markdown())
```
</details>
cc @jbrockmendel I would have expected we had issues about this, but didn't directly find anything | null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59765/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59765/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59764 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59764/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59764/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59764/events | https://github.com/pandas-dev/pandas/issues/59764 | 2,514,370,898 | I_kwDOAA0YD86V3kFS | 59,764 | BUG/inconsistency: pd.Series(dtype=object).sum(skipna=True) does not respect skipna=True | {
"login": "Code0x58",
"id": 9309570,
"node_id": "MDQ6VXNlcjkzMDk1NzA=",
"avatar_url": "https://avatars.githubusercontent.com/u/9309570?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Code0x58",
"html_url": "https://github.com/Code0x58",
"followers_url": "https://api.github.com/users/Code0x58/followers",
"following_url": "https://api.github.com/users/Code0x58/following{/other_user}",
"gists_url": "https://api.github.com/users/Code0x58/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Code0x58/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Code0x58/subscriptions",
"organizations_url": "https://api.github.com/users/Code0x58/orgs",
"repos_url": "https://api.github.com/users/Code0x58/repos",
"events_url": "https://api.github.com/users/Code0x58/events{/privacy}",
"received_events_url": "https://api.github.com/users/Code0x58/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 76811,
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug",
"name": "Bug",
"color": "e10c02",
"default": false,
"description": null
},
{
"id": 2365504383,
"node_id": "MDU6TGFiZWwyMzY1NTA0Mzgz",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Reduction%20Operations",
"name": "Reduction Operations",
"color": "547c03",
"default": false,
"description": "sum, mean, min, max, etc."
},
{
"id": 2365504893,
"node_id": "MDU6TGFiZWwyMzY1NTA0ODkz",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Closing%20Candidate",
"name": "Closing Candidate",
"color": "be21f2",
"default": false,
"description": "May be closeable, needs more eyeballs"
}
] | open | false | null | [] | null | 2 | 2024-09-09T16:13:46 | 2024-09-10T00:19:36 | null | NONE | null | null | null | ### Pandas version checks
- [X] I have checked that this issue has not already been reported.
- [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas.
- [ ] I have confirmed this bug exists on the [main branch](https://pandas.pydata.org/docs/dev/getting_started/install.html#installing-the-development-version-of-pandas) of pandas.
### Reproducible Example
```python
import pandas as pd
import numpy as np
class X:
def __init__(self, n, generation=0):
self.n = n
self.generation = generation
def __add__(self, other):
return X(self.n + other.n, max(self.generation, other.generation) + 1)
def __mul__(self, other):
return X(self.n * other.n, max(self.generation, other.generation) + 1)
def __repr__(self):
return f'X({self.n}, {self.generation})'
s = pd.Series([X(1), X(2), np.nan, X(0)])
# these implicitly have skipna=True anyway
s.sum(skipna=True)
```
### Issue Description
aggregation methods over objects does not respect skipna. Exception produced above
```
# sum, cumsum, prod, cumprod, ...
AttributeError: 'int' object has no attribute 'n'
```
### Expected Behavior
NaN values are skipped.
Given that all-NaN values are documented to produce NaN
### Installed Versions
<details>
```
INSTALLED VERSIONS
------------------
commit : d9cdd2ee5a58015ef6f4d15c7226110c9aab8140
python : 3.12.5.final.0
python-bits : 64
OS : Linux
OS-release : 4.15.0-213-generic
Version : #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
machine : x86_64
processor :
byteorder : little
LC_ALL : None
LANG : C.UTF-8
LOCALE : C.UTF-8
pandas : 2.2.2
numpy : 2.1.1
pytz : 2024.1
dateutil : 2.9.0.post0
setuptools : None
pip : 24.2
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : None
IPython : None
pandas_datareader : None
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : None
bottleneck : None
dataframe-api-compat : None
fastparquet : None
fsspec : None
gcsfs : None
matplotlib : None
numba : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pyreadstat : None
python-calamine : None
pyxlsb : None
s3fs : None
scipy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
zstandard : None
tzdata : 2024.1
qtpy : None
pyqt5 : None
```
</details>
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59764/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59764/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59754 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59754/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59754/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59754/events | https://github.com/pandas-dev/pandas/pull/59754 | 2,512,733,379 | PR_kwDOAA0YD856yTjx | 59,754 | #59009: Added document and a test case for newlines_in_values case. | {
"login": "wooseogchoi",
"id": 15224552,
"node_id": "MDQ6VXNlcjE1MjI0NTUy",
"avatar_url": "https://avatars.githubusercontent.com/u/15224552?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/wooseogchoi",
"html_url": "https://github.com/wooseogchoi",
"followers_url": "https://api.github.com/users/wooseogchoi/followers",
"following_url": "https://api.github.com/users/wooseogchoi/following{/other_user}",
"gists_url": "https://api.github.com/users/wooseogchoi/gists{/gist_id}",
"starred_url": "https://api.github.com/users/wooseogchoi/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/wooseogchoi/subscriptions",
"organizations_url": "https://api.github.com/users/wooseogchoi/orgs",
"repos_url": "https://api.github.com/users/wooseogchoi/repos",
"events_url": "https://api.github.com/users/wooseogchoi/events{/privacy}",
"received_events_url": "https://api.github.com/users/wooseogchoi/received_events",
"type": "User",
"site_admin": false
} | [] | open | false | null | [] | null | 1 | 2024-09-09T01:58:27 | 2024-09-28T01:35:52 | null | CONTRIBUTOR | null | false | {
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/59754",
"html_url": "https://github.com/pandas-dev/pandas/pull/59754",
"diff_url": "https://github.com/pandas-dev/pandas/pull/59754.diff",
"patch_url": "https://github.com/pandas-dev/pandas/pull/59754.patch",
"merged_at": null
} | - [x ] closes #59009 (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
- [ ] 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.
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59754/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59754/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59751 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59751/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59751/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59751/events | https://github.com/pandas-dev/pandas/pull/59751 | 2,512,488,523 | PR_kwDOAA0YD856xiNx | 59,751 | DEPR: Update groupby.apply DeprecationWarning to FutureWarning | {
"login": "rhshadrach",
"id": 45562402,
"node_id": "MDQ6VXNlcjQ1NTYyNDAy",
"avatar_url": "https://avatars.githubusercontent.com/u/45562402?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/rhshadrach",
"html_url": "https://github.com/rhshadrach",
"followers_url": "https://api.github.com/users/rhshadrach/followers",
"following_url": "https://api.github.com/users/rhshadrach/following{/other_user}",
"gists_url": "https://api.github.com/users/rhshadrach/gists{/gist_id}",
"starred_url": "https://api.github.com/users/rhshadrach/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/rhshadrach/subscriptions",
"organizations_url": "https://api.github.com/users/rhshadrach/orgs",
"repos_url": "https://api.github.com/users/rhshadrach/repos",
"events_url": "https://api.github.com/users/rhshadrach/events{/privacy}",
"received_events_url": "https://api.github.com/users/rhshadrach/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 697792067,
"node_id": "MDU6TGFiZWw2OTc3OTIwNjc=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Apply",
"name": "Apply",
"color": "fbca04",
"default": false,
"description": "Apply, Aggregate, Transform, Map"
},
{
"id": 1628184320,
"node_id": "MDU6TGFiZWwxNjI4MTg0MzIw",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Warnings",
"name": "Warnings",
"color": "f2f074",
"default": false,
"description": "Warnings that appear or should be added to pandas"
}
] | open | false | null | [] | null | 1 | 2024-09-08T17:19:52 | 2024-09-09T17:22:41 | null | MEMBER | null | true | {
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/59751",
"html_url": "https://github.com/pandas-dev/pandas/pull/59751",
"diff_url": "https://github.com/pandas-dev/pandas/pull/59751.diff",
"patch_url": "https://github.com/pandas-dev/pandas/pull/59751.patch",
"merged_at": null
} | - [ ] 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.
Ref: https://github.com/pandas-dev/pandas/pull/54950#issuecomment-1896995028 | null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59751/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59751/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59750 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59750/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59750/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59750/events | https://github.com/pandas-dev/pandas/pull/59750 | 2,512,303,850 | PR_kwDOAA0YD856w9p8 | 59,750 | BUG: Fix groupby().any() behavior for timedelta columns with all null valuesfix issue #59712 | {
"login": "40gilad",
"id": 72923562,
"node_id": "MDQ6VXNlcjcyOTIzNTYy",
"avatar_url": "https://avatars.githubusercontent.com/u/72923562?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/40gilad",
"html_url": "https://github.com/40gilad",
"followers_url": "https://api.github.com/users/40gilad/followers",
"following_url": "https://api.github.com/users/40gilad/following{/other_user}",
"gists_url": "https://api.github.com/users/40gilad/gists{/gist_id}",
"starred_url": "https://api.github.com/users/40gilad/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/40gilad/subscriptions",
"organizations_url": "https://api.github.com/users/40gilad/orgs",
"repos_url": "https://api.github.com/users/40gilad/repos",
"events_url": "https://api.github.com/users/40gilad/events{/privacy}",
"received_events_url": "https://api.github.com/users/40gilad/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 76811,
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug",
"name": "Bug",
"color": "e10c02",
"default": false,
"description": null
},
{
"id": 233160,
"node_id": "MDU6TGFiZWwyMzMxNjA=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Groupby",
"name": "Groupby",
"color": "729FCF",
"default": false,
"description": null
},
{
"id": 2822342,
"node_id": "MDU6TGFiZWwyODIyMzQy",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Missing-data",
"name": "Missing-data",
"color": "d7e102",
"default": false,
"description": "np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate"
}
] | open | false | null | [] | null | 6 | 2024-09-08T10:09:58 | 2024-09-27T20:01:19 | null | NONE | null | false | {
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/59750",
"html_url": "https://github.com/pandas-dev/pandas/pull/59750",
"diff_url": "https://github.com/pandas-dev/pandas/pull/59750.diff",
"patch_url": "https://github.com/pandas-dev/pandas/pull/59750.patch",
"merged_at": null
} | This pull request addresses a bug in the `groupby().any()` method when applied to DataFrames with `timedelta` columns where all values are null (`NaT`). Previously, the method incorrectly returned `True` for groups with all null values in the `timedelta` column.
**Changes Made:**
- Updated the `_call_cython_op` method to correctly handle `timedelta` columns when computing the `any()` aggregation.
- Added a new test case to verify that `groupby().any()` returns `False` for groups where all `timedelta` values are null.
**Issue Reference:**
- See issue [#59712](https://github.com/pandas-dev/pandas/issues/59712) for more details about the bug report.
This fix ensures that the `groupby().any()` method behaves consistently for `timedelta` columns, aligning with the behavior observed for other data types.
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59750/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59750/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59744 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59744/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59744/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59744/events | https://github.com/pandas-dev/pandas/pull/59744 | 2,511,651,388 | PR_kwDOAA0YD856uwsp | 59,744 | Doc string for pandas.Timestamp.max, pandas.Timestamp.min | {
"login": "NavaneetthaSundararaj",
"id": 9381322,
"node_id": "MDQ6VXNlcjkzODEzMjI=",
"avatar_url": "https://avatars.githubusercontent.com/u/9381322?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/NavaneetthaSundararaj",
"html_url": "https://github.com/NavaneetthaSundararaj",
"followers_url": "https://api.github.com/users/NavaneetthaSundararaj/followers",
"following_url": "https://api.github.com/users/NavaneetthaSundararaj/following{/other_user}",
"gists_url": "https://api.github.com/users/NavaneetthaSundararaj/gists{/gist_id}",
"starred_url": "https://api.github.com/users/NavaneetthaSundararaj/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/NavaneetthaSundararaj/subscriptions",
"organizations_url": "https://api.github.com/users/NavaneetthaSundararaj/orgs",
"repos_url": "https://api.github.com/users/NavaneetthaSundararaj/repos",
"events_url": "https://api.github.com/users/NavaneetthaSundararaj/events{/privacy}",
"received_events_url": "https://api.github.com/users/NavaneetthaSundararaj/received_events",
"type": "User",
"site_admin": false
} | [] | open | false | null | [] | null | 0 | 2024-09-07T13:37:13 | 2024-09-21T15:23:11 | null | NONE | null | true | {
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/59744",
"html_url": "https://github.com/pandas-dev/pandas/pull/59744",
"diff_url": "https://github.com/pandas-dev/pandas/pull/59744.diff",
"patch_url": "https://github.com/pandas-dev/pandas/pull/59744.patch",
"merged_at": null
} | Context in https://github.com/pandas-dev/pandas/issues/59458
Addressed:
- pandas.Timestamp.max
- pandas.Timestamp.min
Changes done:
- Added docstring for the above
- Added an attribute section | null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59744/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59744/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59743 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59743/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59743/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59743/events | https://github.com/pandas-dev/pandas/pull/59743 | 2,511,444,769 | PR_kwDOAA0YD856uHfq | 59,743 | BUG: Remove `read_json` datetime deprecation warning | {
"login": "KevsterAmp",
"id": 109636487,
"node_id": "U_kgDOBojrhw",
"avatar_url": "https://avatars.githubusercontent.com/u/109636487?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/KevsterAmp",
"html_url": "https://github.com/KevsterAmp",
"followers_url": "https://api.github.com/users/KevsterAmp/followers",
"following_url": "https://api.github.com/users/KevsterAmp/following{/other_user}",
"gists_url": "https://api.github.com/users/KevsterAmp/gists{/gist_id}",
"starred_url": "https://api.github.com/users/KevsterAmp/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/KevsterAmp/subscriptions",
"organizations_url": "https://api.github.com/users/KevsterAmp/orgs",
"repos_url": "https://api.github.com/users/KevsterAmp/repos",
"events_url": "https://api.github.com/users/KevsterAmp/events{/privacy}",
"received_events_url": "https://api.github.com/users/KevsterAmp/received_events",
"type": "User",
"site_admin": false
} | [] | open | false | null | [] | null | 5 | 2024-09-07T03:37:05 | 2024-10-07T23:33:49 | null | CONTRIBUTOR | null | false | {
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/59743",
"html_url": "https://github.com/pandas-dev/pandas/pull/59743",
"diff_url": "https://github.com/pandas-dev/pandas/pull/59743.diff",
"patch_url": "https://github.com/pandas-dev/pandas/pull/59743.patch",
"merged_at": null
} | - [x] closes #59511 (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.
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59743/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59743/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59739 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59739/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59739/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59739/events | https://github.com/pandas-dev/pandas/issues/59739 | 2,510,768,152 | I_kwDOAA0YD86Vp0gY | 59,739 | BUG: FutureWarning for Boolean sparse dtypes in pd.DataFrame.sparse.from_spmatrix() | {
"login": "sammlapp",
"id": 10891273,
"node_id": "MDQ6VXNlcjEwODkxMjcz",
"avatar_url": "https://avatars.githubusercontent.com/u/10891273?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/sammlapp",
"html_url": "https://github.com/sammlapp",
"followers_url": "https://api.github.com/users/sammlapp/followers",
"following_url": "https://api.github.com/users/sammlapp/following{/other_user}",
"gists_url": "https://api.github.com/users/sammlapp/gists{/gist_id}",
"starred_url": "https://api.github.com/users/sammlapp/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sammlapp/subscriptions",
"organizations_url": "https://api.github.com/users/sammlapp/orgs",
"repos_url": "https://api.github.com/users/sammlapp/repos",
"events_url": "https://api.github.com/users/sammlapp/events{/privacy}",
"received_events_url": "https://api.github.com/users/sammlapp/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 76811,
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug",
"name": "Bug",
"color": "e10c02",
"default": false,
"description": null
},
{
"id": 49182326,
"node_id": "MDU6TGFiZWw0OTE4MjMyNg==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Sparse",
"name": "Sparse",
"color": "009800",
"default": false,
"description": "Sparse Data Type"
},
{
"id": 1628184320,
"node_id": "MDU6TGFiZWwxNjI4MTg0MzIw",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Warnings",
"name": "Warnings",
"color": "f2f074",
"default": false,
"description": "Warnings that appear or should be added to pandas"
}
] | open | false | null | [] | {
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/119",
"html_url": "https://github.com/pandas-dev/pandas/milestone/119",
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/119/labels",
"id": 11466880,
"node_id": "MI_kwDOAA0YD84ArviA",
"number": 119,
"title": "2.3",
"description": "on-merge: backport to 2.3.x",
"creator": {
"login": "jorisvandenbossche",
"id": 1020496,
"node_id": "MDQ6VXNlcjEwMjA0OTY=",
"avatar_url": "https://avatars.githubusercontent.com/u/1020496?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/jorisvandenbossche",
"html_url": "https://github.com/jorisvandenbossche",
"followers_url": "https://api.github.com/users/jorisvandenbossche/followers",
"following_url": "https://api.github.com/users/jorisvandenbossche/following{/other_user}",
"gists_url": "https://api.github.com/users/jorisvandenbossche/gists{/gist_id}",
"starred_url": "https://api.github.com/users/jorisvandenbossche/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jorisvandenbossche/subscriptions",
"organizations_url": "https://api.github.com/users/jorisvandenbossche/orgs",
"repos_url": "https://api.github.com/users/jorisvandenbossche/repos",
"events_url": "https://api.github.com/users/jorisvandenbossche/events{/privacy}",
"received_events_url": "https://api.github.com/users/jorisvandenbossche/received_events",
"type": "User",
"site_admin": false
},
"open_issues": 37,
"closed_issues": 70,
"state": "open",
"created_at": "2024-08-20T19:39:44",
"updated_at": "2024-10-03T20:12:23",
"due_on": null,
"closed_at": null
} | 1 | 2024-09-06T16:09:21 | 2024-09-21T12:12:37 | null | NONE | null | null | null | ### Pandas version checks
- [X] I have checked that this issue has not already been reported.
- [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas.
- [ ] I have confirmed this bug exists on the [main branch](https://pandas.pydata.org/docs/dev/getting_started/install.html#installing-the-development-version-of-pandas) of pandas.
### Reproducible Example
```python
import scipy
import pandas as pd
coo = scipy.sparse.coo_matrix([[False,True],[True,False]])
pd.DataFrame.sparse.from_spmatrix(coo) # results in FutureWarning
coo = scipy.sparse.coo_matrix([[0,1],[1,0]])
pd.DataFrame.sparse.from_spmatrix(coo) # no warnings
```
### Issue Description
Attempting to use from_spmatrix() with a boolean-type scipy.sparse matrix raises a warning about arbitrary scalar fill_value:
> FutureWarning: Allowing arbitrary scalar fill_value in SparseDtype is deprecated. In a future version, the fill_value must be a valid value for the SparseDtype.subtype.
pd.DataFrame.sparse.from_spmatrix(coo)
but using sparse integer dtype for the scipy matrix does not. I don't understand why this occurs, but it seems like from_spmatrix should be able to handle both of these scenarios. Also, there is no argument to from_spmatrix to specify a type, so it is unclear what the user should do about this future warning if anything.
### Expected Behavior
No warning, uses dtype matching input
### Installed Versions
<details>
INSTALLED VERSIONS
------------------
commit : d9cdd2ee5a58015ef6f4d15c7226110c9aab8140
python : 3.9.13.final.0
python-bits : 64
OS : Darwin
OS-release : 21.6.0
Version : Darwin Kernel Version 21.6.0: Mon Aug 22 20:19:52 PDT 2022; root:xnu-8020.140.49~2/RELEASE_ARM64_T6000
machine : arm64
processor : arm
byteorder : little
LC_ALL : None
LANG : None
LOCALE : None.UTF-8
pandas : 2.2.2
numpy : 1.26.4
pytz : 2024.1
dateutil : 2.9.0.post0
setuptools : 70.1.0
pip : 22.1.2
Cython : None
pytest : 8.2.2
hypothesis : None
sphinx : 7.3.7
blosc : None
feather : None
xlsxwriter : None
lxml.etree : 4.9.3
html5lib : 1.1
pymysql : None
psycopg2 : None
jinja2 : 3.1.4
IPython : 8.18.1
pandas_datareader : None
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : 4.12.3
bottleneck : None
dataframe-api-compat : None
fastparquet : None
fsspec : 2024.6.0
gcsfs : None
matplotlib : 3.9.0
numba : 0.60.0
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pyreadstat : None
python-calamine : None
pyxlsb : None
s3fs : None
scipy : 1.13.1
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
zstandard : None
tzdata : 2024.1
qtpy : None
pyqt5 : None
</details>
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59739/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59739/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59738 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59738/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59738/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59738/events | https://github.com/pandas-dev/pandas/issues/59738 | 2,510,767,093 | I_kwDOAA0YD86Vp0P1 | 59,738 | BUG: fixed_size_list pyarrow type not interpretable on round-trip write/read. | {
"login": "delucchi-cmu",
"id": 113376043,
"node_id": "U_kgDOBsH7Kw",
"avatar_url": "https://avatars.githubusercontent.com/u/113376043?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/delucchi-cmu",
"html_url": "https://github.com/delucchi-cmu",
"followers_url": "https://api.github.com/users/delucchi-cmu/followers",
"following_url": "https://api.github.com/users/delucchi-cmu/following{/other_user}",
"gists_url": "https://api.github.com/users/delucchi-cmu/gists{/gist_id}",
"starred_url": "https://api.github.com/users/delucchi-cmu/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/delucchi-cmu/subscriptions",
"organizations_url": "https://api.github.com/users/delucchi-cmu/orgs",
"repos_url": "https://api.github.com/users/delucchi-cmu/repos",
"events_url": "https://api.github.com/users/delucchi-cmu/events{/privacy}",
"received_events_url": "https://api.github.com/users/delucchi-cmu/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 76811,
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug",
"name": "Bug",
"color": "e10c02",
"default": false,
"description": null
},
{
"id": 219960758,
"node_id": "MDU6TGFiZWwyMTk5NjA3NTg=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Needs%20Discussion",
"name": "Needs Discussion",
"color": "207de5",
"default": false,
"description": "Requires discussion from core team before further action"
},
{
"id": 685114413,
"node_id": "MDU6TGFiZWw2ODUxMTQ0MTM=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/IO%20Parquet",
"name": "IO Parquet",
"color": "5319e7",
"default": false,
"description": "parquet, feather"
},
{
"id": 3303158446,
"node_id": "MDU6TGFiZWwzMzAzMTU4NDQ2",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Arrow",
"name": "Arrow",
"color": "f9d0c4",
"default": false,
"description": "pyarrow functionality"
}
] | open | false | null | [] | null | 2 | 2024-09-06T16:08:48 | 2024-09-15T19:00:41 | null | NONE | null | null | null | ### Pandas version checks
- [X] I have checked that this issue has not already been reported.
- [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas.
- [ ] I have confirmed this bug exists on the [main branch](https://pandas.pydata.org/docs/dev/getting_started/install.html#installing-the-development-version-of-pandas) of pandas.
### Reproducible Example
```python
import pandas as pd
import pyarrow as pa
a = pa.array([1, 2, 3])
b = pa.array([[True, False, True]] * 3, type=pa.list_(pa.bool_(), 3))
table = pa.Table.from_arrays([a, b], names=['a', 'b'])
pa_table = table.to_pandas(types_mapper=pd.ArrowDtype)
pa_table.to_parquet("using_types_mapper.parquet")
data_frame = pd.read_parquet("using_types_mapper.parquet")
```
### Issue Description
In the example, we convert the PyArrow table to a pandas DataFrame, using the types mapper to enforce the `fixed_size_list` type of column `b`.
As of the versions indicated below, this results in the following error:
```
NotImplementedError: Passing pyarrow type specific parameters ([3]) in the string is not supported. Please construct an ArrowDtype object with a pyarrow_dtype instance with specific parameters.
```
If you inspect the generated file, you see that the pyarrow schema reflects the `fixed_size_list`. e.g `pq.read_metadata("using_types_mapper.parquet").schema.to_arrow_schema()`.
If, instead, you do not indicate a types mapper, the type of `fixed_size_list` is lost, and the parquet file on-disk just uses a `list` type:
```
import pandas as pd
import pyarrow as pa
a = pa.array([1, 2, 3])
b = pa.array([[True, False, True]] * 3, type=pa.list_(pa.bool_(), 3))
table = pa.Table.from_arrays([a, b], names=['a', 'b'])
pa_table = table.to_pandas() # this is the different line
pa_table.to_parquet("loses_fixed_size.parquet")
data_frame = pd.read_parquet("loses_fixed_size.parquet")
display(pq.read_metadata("loses_fixed_size.parquet").schema.to_arrow_schema())
```
### Expected Behavior
I would expect to
- read the parquet file without error
- for the returned dataframe to have *some kind* of list type for column `b`
- for the parquet file's on-disk metadata to still include a `fixed_size_list` type for column `b`
### Installed Versions
<details>
INSTALLED VERSIONS
------------------
commit : d9cdd2ee5a58015ef6f4d15c7226110c9aab8140
python : 3.11.9.final.0
python-bits : 64
OS : Linux
OS-release : 6.5.0-1025-oem
Version : #26-Ubuntu SMP PREEMPT_DYNAMIC Tue Jun 18 12:35:22 UTC 2024
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 2.2.2
numpy : 2.1.1
pytz : 2024.1
dateutil : 2.9.0
setuptools : 72.1.0
pip : 24.2
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : None
IPython : 8.27.0
pandas_datareader : None
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : None
bottleneck : None
dataframe-api-compat : None
fastparquet : None
fsspec : None
gcsfs : None
matplotlib : None
numba : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : 17.0.0
pyreadstat : None
python-calamine : None
pyxlsb : None
s3fs : None
scipy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
zstandard : None
tzdata : 2024.1
qtpy : None
pyqt5 : None
</details>
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59738/reactions",
"total_count": 1,
"+1": 1,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59738/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59737 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59737/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59737/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59737/events | https://github.com/pandas-dev/pandas/issues/59737 | 2,510,621,084 | I_kwDOAA0YD86VpQmc | 59,737 | ENH: DataFrame.from_dict doesn't work with collections.UserDict objects | {
"login": "mesvam",
"id": 14833020,
"node_id": "MDQ6VXNlcjE0ODMzMDIw",
"avatar_url": "https://avatars.githubusercontent.com/u/14833020?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/mesvam",
"html_url": "https://github.com/mesvam",
"followers_url": "https://api.github.com/users/mesvam/followers",
"following_url": "https://api.github.com/users/mesvam/following{/other_user}",
"gists_url": "https://api.github.com/users/mesvam/gists{/gist_id}",
"starred_url": "https://api.github.com/users/mesvam/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mesvam/subscriptions",
"organizations_url": "https://api.github.com/users/mesvam/orgs",
"repos_url": "https://api.github.com/users/mesvam/repos",
"events_url": "https://api.github.com/users/mesvam/events{/privacy}",
"received_events_url": "https://api.github.com/users/mesvam/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 76812,
"node_id": "MDU6TGFiZWw3NjgxMg==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Enhancement",
"name": "Enhancement",
"color": "4E9A06",
"default": false,
"description": null
},
{
"id": 2301354,
"node_id": "MDU6TGFiZWwyMzAxMzU0",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/IO%20Data",
"name": "IO Data",
"color": "06909A",
"default": false,
"description": "IO issues that don't fit into a more specific label"
},
{
"id": 219960758,
"node_id": "MDU6TGFiZWwyMTk5NjA3NTg=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Needs%20Discussion",
"name": "Needs Discussion",
"color": "207de5",
"default": false,
"description": "Requires discussion from core team before further action"
},
{
"id": 1465286368,
"node_id": "MDU6TGFiZWwxNDY1Mjg2MzY4",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Constructors",
"name": "Constructors",
"color": "d4c5f9",
"default": false,
"description": "Series/DataFrame/Index/pd.array Constructors"
}
] | open | false | null | [] | null | 6 | 2024-09-06T14:53:29 | 2024-09-21T02:18:09 | null | NONE | null | null | null | ### Pandas version checks
- [X] I have checked that this issue has not already been reported.
- [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas.
- [ ] I have confirmed this bug exists on the [main branch](https://pandas.pydata.org/docs/dev/getting_started/install.html#installing-the-development-version-of-pandas) of pandas.
### Reproducible Example
```python
from collections import UserDict
class CustomDict(UserDict):
pass
cd = CustomDict(col_1=[1,2], col_2=[3,4])
pd.DataFrame.from_dict(cd)
```
output:
```
0
0 col_1
1 col_2
```
### Issue Description
Pandas will not accept UserDict and other custom dict-like objects for DataFrame creation. Subclassing dict instead of UserDict is a workaround for this example, but for a variety of complicated reasons (examples: [1](https://stackoverflow.com/a/64646485/823633), [2](https://stackoverflow.com/a/7148602/823633), [3](https://stackoverflow.com/a/64450669/823633)) it is sometimes undesirable to subclass dict.
### Expected Behavior
The output should be the same as
```python
pd.DataFrame.from_dict(dict(cd))
```
output
```
col_1 col_2
0 1 3
1 2 4
```
### Installed Versions
<details>
INSTALLED VERSIONS
------------------
commit : d9cdd2ee5a58015ef6f4d15c7226110c9aab8140
python : 3.11.9.final.0
python-bits : 64
OS : Windows
OS-release : 10
Version : 10.0.22000
machine : AMD64
processor : Intel64 Family 6 Model 151 Stepping 5, GenuineIntel
byteorder : little
LC_ALL : None
LANG : None
LOCALE : English_United States.1252
pandas : 2.2.2
numpy : 1.26.4
pytz : 2024.1
dateutil : 2.9.0.post0
setuptools : 72.1.0
pip : 24.2
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : 5.2.1
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 3.1.4
IPython : 8.25.0
pandas_datareader : None
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : 4.12.3
bottleneck : 1.3.7
dataframe-api-compat : None
fastparquet : None
fsspec : None
gcsfs : None
matplotlib : 3.8.4
numba : 0.60.0
numexpr : 2.8.7
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pyreadstat : None
python-calamine : None
pyxlsb : None
s3fs : None
scipy : 1.13.1
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
zstandard : 0.22.0
tzdata : 2023.3
qtpy : None
pyqt5 : None
</details>
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59737/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59737/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59736 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59736/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59736/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59736/events | https://github.com/pandas-dev/pandas/issues/59736 | 2,510,587,701 | I_kwDOAA0YD86VpIc1 | 59,736 | BUG: pd.eval with engine="numexpr" fails with simple expressions with float literals | {
"login": "fdrocha",
"id": 99990201,
"node_id": "U_kgDOBfW6uQ",
"avatar_url": "https://avatars.githubusercontent.com/u/99990201?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/fdrocha",
"html_url": "https://github.com/fdrocha",
"followers_url": "https://api.github.com/users/fdrocha/followers",
"following_url": "https://api.github.com/users/fdrocha/following{/other_user}",
"gists_url": "https://api.github.com/users/fdrocha/gists{/gist_id}",
"starred_url": "https://api.github.com/users/fdrocha/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/fdrocha/subscriptions",
"organizations_url": "https://api.github.com/users/fdrocha/orgs",
"repos_url": "https://api.github.com/users/fdrocha/repos",
"events_url": "https://api.github.com/users/fdrocha/events{/privacy}",
"received_events_url": "https://api.github.com/users/fdrocha/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 76811,
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug",
"name": "Bug",
"color": "e10c02",
"default": false,
"description": null
},
{
"id": 1631985267,
"node_id": "MDU6TGFiZWwxNjMxOTg1MjY3",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/expressions",
"name": "expressions",
"color": "f3afff",
"default": false,
"description": "pd.eval, query"
}
] | open | false | null | [] | null | 15 | 2024-09-06T14:36:04 | 2024-09-27T08:49:03 | null | NONE | null | null | null | ### Pandas version checks
- [X] I have checked that this issue has not already been reported.
- [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas.
- [ ] I have confirmed this bug exists on the [main branch](https://pandas.pydata.org/docs/dev/getting_started/install.html#installing-the-development-version-of-pandas) of pandas.
### Reproducible Example
```python
import pandas as pd
pd.eval("1/2", engine="numexpr")
```
### Issue Description
This throws an exception
```ValueError: Expression (np.float64(1.0)) / (np.float64(2.0)) has forbidden control characters.```
Changing engine to "python" makes it work again. Strangely, replacing the division with any other operator also fixes things. I tried this in a clean venv with just the minimal packages installed.
This is similar to older #54542 but different. If I try to run the expression pandas is generating directly in numexpr I get the same error. Using `sanitize=False` is not enough to make it work however
```python
import numexpr as ne
ne.evaluate("(np.float64(1.0)) / (np.float64(2.0))", sanitize=False)
```
This leads to a different exception: `AttributeError: 'VariableNode' object has no attribute 'float64'`.
Not sure if this is really a bug in pandas or numexpr. It seems related to numpy 2.0 as well.
### Expected Behavior
It should just return 0.5.
### Installed Versions
<details>
INSTALLED VERSIONS
------------------
commit : d9cdd2ee5a58015ef6f4d15c7226110c9aab8140
python : 3.11.7.final.0
python-bits : 64
OS : Darwin
OS-release : 22.6.0
Version : Darwin Kernel Version 22.6.0: Mon Jun 24 01:25:37 PDT 2024; root:xnu-8796.141.3.706.2~1/RELEASE_X86_64
machine : x86_64
processor : i386
byteorder : little
LC_ALL : None
LANG : en_US
LOCALE : en_US.UTF-8
pandas : 2.2.2
numpy : 2.1.1
pytz : 2024.1
dateutil : 2.9.0.post0
setuptools : 65.5.0
pip : 24.2
Cython : None
pytest : None
hypothesis : 6.112.0
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : None
IPython : None
pandas_datareader : None
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : None
bottleneck : None
dataframe-api-compat : None
fastparquet : None
fsspec : None
gcsfs : None
matplotlib : None
numba : None
numexpr : 2.10.1
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pyreadstat : None
python-calamine : None
pyxlsb : None
s3fs : None
scipy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
zstandard : None
tzdata : None
qtpy : None
pyqt5 : None
</details>
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59736/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59736/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59732 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59732/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59732/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59732/events | https://github.com/pandas-dev/pandas/issues/59732 | 2,509,689,900 | I_kwDOAA0YD86VltQs | 59,732 | BUG: df.loc astype type change on specific row not working | {
"login": "ganbaaelmer",
"id": 44351763,
"node_id": "MDQ6VXNlcjQ0MzUxNzYz",
"avatar_url": "https://avatars.githubusercontent.com/u/44351763?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ganbaaelmer",
"html_url": "https://github.com/ganbaaelmer",
"followers_url": "https://api.github.com/users/ganbaaelmer/followers",
"following_url": "https://api.github.com/users/ganbaaelmer/following{/other_user}",
"gists_url": "https://api.github.com/users/ganbaaelmer/gists{/gist_id}",
"starred_url": "https://api.github.com/users/ganbaaelmer/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ganbaaelmer/subscriptions",
"organizations_url": "https://api.github.com/users/ganbaaelmer/orgs",
"repos_url": "https://api.github.com/users/ganbaaelmer/repos",
"events_url": "https://api.github.com/users/ganbaaelmer/events{/privacy}",
"received_events_url": "https://api.github.com/users/ganbaaelmer/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 76811,
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug",
"name": "Bug",
"color": "e10c02",
"default": false,
"description": null
},
{
"id": 57522093,
"node_id": "MDU6TGFiZWw1NzUyMjA5Mw==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Strings",
"name": "Strings",
"color": "5319e7",
"default": false,
"description": "String extension data type and string data"
},
{
"id": 219960758,
"node_id": "MDU6TGFiZWwyMTk5NjA3NTg=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Needs%20Discussion",
"name": "Needs Discussion",
"color": "207de5",
"default": false,
"description": "Requires discussion from core team before further action"
}
] | open | false | null | [] | null | 2 | 2024-09-06T07:08:39 | 2024-09-10T03:53:50 | null | NONE | null | null | null | ### Pandas version checks
- [X] I have checked that this issue has not already been reported.
- [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas.
- [X] I have confirmed this bug exists on the [main branch](https://pandas.pydata.org/docs/dev/getting_started/install.html#installing-the-development-version-of-pandas) of pandas.
### Reproducible Example
```python
df.loc[index, 'column_name'].astype(str)
```
### Issue Description
astype(str) not working
### Expected Behavior
object to str not working. dtype still object
### Installed Versions
<details>
INSTALLED VERSIONS
------------------
commit : d9cdd2ee5a58015ef6f4d15c7226110c9aab8140
python : 3.12.4.final.0
python-bits : 64
OS : Windows
OS-release : 11
Version : 10.0.22631
machine : AMD64
processor : Intel64 Family 6 Model 151 Stepping 5, GenuineIntel
byteorder : little
LC_ALL : None
LANG : None
LOCALE : English_United States.1252
pandas : 2.2.2
numpy : 1.26.4
pytz : 2024.1
dateutil : 2.9.0.post0
setuptools : 69.5.1
pip : 24.0
Cython : None
pytest : 7.4.4
hypothesis : None
sphinx : 7.3.7
blosc : None
feather : None
xlsxwriter : None
lxml.etree : 5.2.1
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 3.1.4
IPython : 8.25.0
pandas_datareader : None
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : 4.12.3
bottleneck : 1.3.7
dataframe-api-compat : None
fastparquet : None
fsspec : 2024.3.1
gcsfs : None
matplotlib : 3.8.4
numba : 0.59.1
numexpr : 2.8.7
odfpy : None
openpyxl : 3.1.2
pandas_gbq : None
pyarrow : 14.0.2
pyreadstat : None
python-calamine : None
pyxlsb : None
s3fs : 2024.3.1
scipy : 1.13.1
sqlalchemy : 2.0.30
tables : 3.9.2
tabulate : 0.9.0
xarray : 2023.6.0
xlrd : None
zstandard : 0.22.0
tzdata : 2023.3
qtpy : 2.4.1
pyqt5 : None
</details>
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59732/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59732/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59725 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59725/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59725/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59725/events | https://github.com/pandas-dev/pandas/issues/59725 | 2,508,796,032 | I_kwDOAA0YD86ViTCA | 59,725 | ENH: Should groupby's `value_counts` sorts on `count` before `proportion` is computed | {
"login": "sfc-gh-joshi",
"id": 149419494,
"node_id": "U_kgDOCOf15g",
"avatar_url": "https://avatars.githubusercontent.com/u/149419494?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/sfc-gh-joshi",
"html_url": "https://github.com/sfc-gh-joshi",
"followers_url": "https://api.github.com/users/sfc-gh-joshi/followers",
"following_url": "https://api.github.com/users/sfc-gh-joshi/following{/other_user}",
"gists_url": "https://api.github.com/users/sfc-gh-joshi/gists{/gist_id}",
"starred_url": "https://api.github.com/users/sfc-gh-joshi/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sfc-gh-joshi/subscriptions",
"organizations_url": "https://api.github.com/users/sfc-gh-joshi/orgs",
"repos_url": "https://api.github.com/users/sfc-gh-joshi/repos",
"events_url": "https://api.github.com/users/sfc-gh-joshi/events{/privacy}",
"received_events_url": "https://api.github.com/users/sfc-gh-joshi/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 76812,
"node_id": "MDU6TGFiZWw3NjgxMg==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Enhancement",
"name": "Enhancement",
"color": "4E9A06",
"default": false,
"description": null
},
{
"id": 233160,
"node_id": "MDU6TGFiZWwyMzMxNjA=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Groupby",
"name": "Groupby",
"color": "729FCF",
"default": false,
"description": null
},
{
"id": 57296398,
"node_id": "MDU6TGFiZWw1NzI5NjM5OA==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Algos",
"name": "Algos",
"color": "eb6420",
"default": false,
"description": "Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff"
},
{
"id": 219960758,
"node_id": "MDU6TGFiZWwyMTk5NjA3NTg=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Needs%20Discussion",
"name": "Needs Discussion",
"color": "207de5",
"default": false,
"description": "Requires discussion from core team before further action"
}
] | open | false | null | [] | null | 1 | 2024-09-05T21:37:06 | 2024-09-07T10:37:18 | null | NONE | null | null | null | ### Pandas version checks
- [X] I have checked that this issue has not already been reported.
- [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas.
- [X] I have confirmed this bug exists on the [main branch](https://pandas.pydata.org/docs/dev/getting_started/install.html#installing-the-development-version-of-pandas) of pandas.
### Reproducible Example
```python
import pandas as pd
data = {"by": ["a", "a", "a", "b", "b", "b", "b", "b", "b"], "values": [1, 1, 0, 1, 1, 1, 0, 0, 0]}
df = pd.DataFrame(data)
df.groupby(by="by", sort=False).value_counts(sort=True, normalize=True)
```
### Issue Description
(continued from #59307)
Per documentation, the `sort` flag of `value_counts` will "Sort by frequencies." The current behavior of `GroupBy.value_counts` follows this to the letter, and even when `normalize=True` is set, the resulting frame is sorted by the `count` column.
However, when `groupby` is called with `sort=False`, the order of the (integer) counts will not necessarily be the same as the order of the (fractional) proportions. This issue is unique to `groupby(sort=False)` because for `groupby(sort=True)`, frequencies are sorted within groups; since the denominator of the proportions is the size of each group, their orderings end up being equivalent.
In the specific case where `groupby` is called with `sort=False`, and `value_counts` is called with `normalize=True` and `sort=True`, this may result in counterintuitive behavior where the `proportion` column is actually NOT sorted. The output of the above example is as follows:
```
>>> import pandas as pd
>>> data = {"by": ["a", "a", "a", "b", "b", "b", "b", "b", "b"], "values": [1, 1, 0, 1, 1, 1, 0, 0, 0]}
>>> df = pd.DataFrame(data)
>>> df.groupby(by="by", sort=False).value_counts(sort=True, normalize=True)
by values
b 1 0.500000
0 0.500000
a 1 0.666667
0 0.333333
Name: proportion, dtype: float64
>>> df.groupby(by="by", sort=False).value_counts(sort=True, normalize=False)
by values
b 1 3
0 3
a 1 2
0 1
Name: count, dtype: int64
```
Group `a` has 3 items, so a value appearing 2 times has a proportion of 0.66…. Group `b` has 6 items, so a value appearing 3 times has a proportion of 0.5. IMO when the `sort` flag is passed in this scenario, the sort should be performed on the normalized proportions rather than the frequencies, since under current behavior, passing `sort=True` would result in a frame that isn't actually sorted.
### Expected Behavior
Existing behavior agrees with documentation, but IMO this existing behavior should be modified to sort on `proportion` rather than un-normalized frequencies to ensure the result frame is sorted.
### Installed Versions
<details>
INSTALLED VERSIONS
------------------
commit : 67a58cddc2f8c0e30cb0123589947d9b3f073720
python : 3.11.7
python-bits : 64
OS : Darwin
OS-release : 23.6.0
Version : Darwin Kernel Version 23.6.0: Mon Jul 29 21:13:04 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T6020
machine : arm64
processor : arm
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 3.0.0.dev0+1239.g67a58cddc2
numpy : 2.1.0.dev0+git20240720.d489c83
pytz : 2024.1
dateutil : 2.9.0.post0
pip : 23.3.1
Cython : None
sphinx : None
IPython : None
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : None
blosc : None
bottleneck : None
fastparquet : None
fsspec : None
html5lib : None
hypothesis : None
gcsfs : None
jinja2 : None
lxml.etree : None
matplotlib : None
numba : None
numexpr : None
odfpy : None
openpyxl : None
psycopg2 : None
pymysql : None
pyarrow : None
pyreadstat : None
pytest : None
python-calamine : None
pyxlsb : None
s3fs : None
scipy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlsxwriter : None
zstandard : None
tzdata : 2023.4
qtpy : None
pyqt5 : None
</details>
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59725/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59725/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59722 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59722/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59722/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59722/events | https://github.com/pandas-dev/pandas/pull/59722 | 2,508,558,388 | PR_kwDOAA0YD856kTbp | 59,722 | Fix part of docstring timedelta #59698 | {
"login": "ammar-qazi",
"id": 177272062,
"node_id": "U_kgDOCpD0_g",
"avatar_url": "https://avatars.githubusercontent.com/u/177272062?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ammar-qazi",
"html_url": "https://github.com/ammar-qazi",
"followers_url": "https://api.github.com/users/ammar-qazi/followers",
"following_url": "https://api.github.com/users/ammar-qazi/following{/other_user}",
"gists_url": "https://api.github.com/users/ammar-qazi/gists{/gist_id}",
"starred_url": "https://api.github.com/users/ammar-qazi/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ammar-qazi/subscriptions",
"organizations_url": "https://api.github.com/users/ammar-qazi/orgs",
"repos_url": "https://api.github.com/users/ammar-qazi/repos",
"events_url": "https://api.github.com/users/ammar-qazi/events{/privacy}",
"received_events_url": "https://api.github.com/users/ammar-qazi/received_events",
"type": "User",
"site_admin": false
} | [] | open | false | null | [] | null | 0 | 2024-09-05T19:25:50 | 2024-09-14T12:42:06 | null | CONTRIBUTOR | null | false | {
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/59722",
"html_url": "https://github.com/pandas-dev/pandas/pull/59722",
"diff_url": "https://github.com/pandas-dev/pandas/pull/59722.diff",
"patch_url": "https://github.com/pandas-dev/pandas/pull/59722.patch",
"merged_at": null
} | Part of [59698](https://github.com/pandas-dev/pandas/issues/59698)
Addresses:
pandas.Timedelta
Added the missing explanations (PRO2) for min, max, and resolution.
Removed:
- i "pandas.Timedelta.resolution PR02" \
- i "pandas.Timedelta.min PR02" \
- i "pandas.Timedelta.resolution PR02" \
from code_checks.sh
p.s. I'm not 100% confident if this is the appropriate way to document these attributes. That said, they're being defined by a class called `MinMaxReso`, and they don't have their separate definitions per se. So, I found this most appropriate way to document them. | null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59722/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59722/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59721 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59721/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59721/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59721/events | https://github.com/pandas-dev/pandas/issues/59721 | 2,508,391,458 | I_kwDOAA0YD86VgwQi | 59,721 | BUG: `pd.read_html(...)`: Unable to handle malformed `colspan` / `rowspan` | {
"login": "ahmedelq",
"id": 11134754,
"node_id": "MDQ6VXNlcjExMTM0NzU0",
"avatar_url": "https://avatars.githubusercontent.com/u/11134754?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ahmedelq",
"html_url": "https://github.com/ahmedelq",
"followers_url": "https://api.github.com/users/ahmedelq/followers",
"following_url": "https://api.github.com/users/ahmedelq/following{/other_user}",
"gists_url": "https://api.github.com/users/ahmedelq/gists{/gist_id}",
"starred_url": "https://api.github.com/users/ahmedelq/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ahmedelq/subscriptions",
"organizations_url": "https://api.github.com/users/ahmedelq/orgs",
"repos_url": "https://api.github.com/users/ahmedelq/repos",
"events_url": "https://api.github.com/users/ahmedelq/events{/privacy}",
"received_events_url": "https://api.github.com/users/ahmedelq/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 76811,
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug",
"name": "Bug",
"color": "e10c02",
"default": false,
"description": null
},
{
"id": 57395487,
"node_id": "MDU6TGFiZWw1NzM5NTQ4Nw==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/IO%20HTML",
"name": "IO HTML",
"color": "006b75",
"default": false,
"description": "read_html, to_html, Styler.apply, Styler.applymap"
},
{
"id": 2365504893,
"node_id": "MDU6TGFiZWwyMzY1NTA0ODkz",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Closing%20Candidate",
"name": "Closing Candidate",
"color": "be21f2",
"default": false,
"description": "May be closeable, needs more eyeballs"
}
] | open | false | null | [] | null | 4 | 2024-09-05T17:46:34 | 2024-09-09T21:19:18 | null | NONE | null | null | null | ### Pandas version checks
- [X] I have checked that this issue has not already been reported.
- [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas.
- [X] I have confirmed this bug exists on the [main branch](https://pandas.pydata.org/docs/dev/getting_started/install.html#installing-the-development-version-of-pandas) of pandas.
### Reproducible Example
```python
import pandas as pd
tables = pd.read_html("https://en.wikipedia.org/wiki/Kyrgyz_alphabets")
```
### Issue Description
The problem arises because of a malformed `colspan` found in a Wikipedia table having a value of `2;` instead of `2`.

The issue stems from this line:
https://github.com/pandas-dev/pandas/blob/85be99eac9b78afcf98955cd85c60d75c5726242/pandas/io/html.py#L514
```
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In[16], line 1
----> 1 tables = pd.read_html("https://en.wikipedia.org/wiki/Kyrgyz_alphabets", converters=defaultdict(lambda: str))
File ~/.local/lib/python3.12/site-packages/pandas/io/html.py:1240, in read_html(io, match, flavor, header, index_col, skiprows, attrs, parse_dates, thousands, encoding, decimal, converters, na_values, keep_default_na, displayed_only, extract_links, dtype_backend, storage_options)
1224 if isinstance(io, str) and not any(
1225 [
1226 is_file_like(io),
(...)
1230 ]
1231 ):
1232 warnings.warn(
1233 "Passing literal html to 'read_html' is deprecated and "
1234 "will be removed in a future version. To read from a "
(...)
1237 stacklevel=find_stack_level(),
1238 )
-> 1240 return _parse(
1241 flavor=flavor,
1242 io=io,
1243 match=match,
1244 header=header,
1245 index_col=index_col,
1246 skiprows=skiprows,
1247 parse_dates=parse_dates,
1248 thousands=thousands,
1249 attrs=attrs,
1250 encoding=encoding,
1251 decimal=decimal,
1252 converters=converters,
1253 na_values=na_values,
1254 keep_default_na=keep_default_na,
1255 displayed_only=displayed_only,
1256 extract_links=extract_links,
1257 dtype_backend=dtype_backend,
1258 storage_options=storage_options,
1259 )
File ~/.local/lib/python3.12/site-packages/pandas/io/html.py:1006, in _parse(flavor, io, match, attrs, encoding, displayed_only, extract_links, storage_options, **kwargs)
1003 raise retained
1005 ret = []
-> 1006 for table in tables:
1007 try:
1008 df = _data_to_frame(data=table, **kwargs)
File ~/.local/lib/python3.12/site-packages/pandas/io/html.py:250, in <genexpr>(.0)
242 """
243 Parse and return all tables from the DOM.
244
(...)
247 list of parsed (header, body, footer) tuples from tables.
248 """
249 tables = self._parse_tables(self._build_doc(), self.match, self.attrs)
--> 250 return (self._parse_thead_tbody_tfoot(table) for table in tables)
File ~/.local/lib/python3.12/site-packages/pandas/io/html.py:465, in _HtmlFrameParser._parse_thead_tbody_tfoot(self, table_html)
462 header_rows.append(body_rows.pop(0))
464 header = self._expand_colspan_rowspan(header_rows, section="header")
--> 465 body = self._expand_colspan_rowspan(body_rows, section="body")
466 footer = self._expand_colspan_rowspan(footer_rows, section="footer")
468 return header, body, footer
File ~/.local/lib/python3.12/site-packages/pandas/io/html.py:521, in _HtmlFrameParser._expand_colspan_rowspan(self, rows, section)
519 text = (text, href)
520 rowspan = int(self._attr_getter(td, "rowspan") or 1)
--> 521 colspan = int(self._attr_getter(td, "colspan") or 1)
523 for _ in range(colspan):
524 texts.append(text)
ValueError: invalid literal for int() with base 10: '2;'
```
### Expected Behavior
Expected behavior is to sanitize the malformed colspan value proceed with `2`.
### Installed Versions
<details>
INSTALLED VERSIONS
------------------
commit : d9cdd2ee5a58015ef6f4d15c7226110c9aab8140
python : 3.12.5.final.0
python-bits : 64
OS : Linux
machine : x86_64
processor :
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 2.2.2
numpy : 1.26.4
pytz : 2024.1
dateutil : 2.9.0
setuptools : 69.5.1
pip : 24.2
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : 5.2.1
html5lib : 1.1
pymysql : None
psycopg2 : None
jinja2 : 3.1.4
IPython : 8.24.0
pandas_datareader : None
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : 4.12.3
bottleneck : None
dataframe-api-compat : None
fastparquet : None
fsspec : None
gcsfs : None
matplotlib : 3.9.1
numba : None
numexpr : None
odfpy : None
openpyxl : 3.1.5
pandas_gbq : None
pyarrow : None
pyreadstat : None
python-calamine : None
pyxlsb : None
s3fs : None
scipy : 1.14.0
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
zstandard : None
tzdata : 2024.1
qtpy : 2.4.1
pyqt5 : None
</details>
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59721/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59721/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59716 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59716/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59716/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59716/events | https://github.com/pandas-dev/pandas/issues/59716 | 2,507,147,125 | I_kwDOAA0YD86VcAd1 | 59,716 | QST: DataFrame.plot() vs Series.plot() have inconsistency wrt reuse plot | {
"login": "pollo-coder",
"id": 15961368,
"node_id": "MDQ6VXNlcjE1OTYxMzY4",
"avatar_url": "https://avatars.githubusercontent.com/u/15961368?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/pollo-coder",
"html_url": "https://github.com/pollo-coder",
"followers_url": "https://api.github.com/users/pollo-coder/followers",
"following_url": "https://api.github.com/users/pollo-coder/following{/other_user}",
"gists_url": "https://api.github.com/users/pollo-coder/gists{/gist_id}",
"starred_url": "https://api.github.com/users/pollo-coder/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/pollo-coder/subscriptions",
"organizations_url": "https://api.github.com/users/pollo-coder/orgs",
"repos_url": "https://api.github.com/users/pollo-coder/repos",
"events_url": "https://api.github.com/users/pollo-coder/events{/privacy}",
"received_events_url": "https://api.github.com/users/pollo-coder/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 2413328,
"node_id": "MDU6TGFiZWwyNDEzMzI4",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Visualization",
"name": "Visualization",
"color": "8AE234",
"default": false,
"description": "plotting"
},
{
"id": 34444536,
"node_id": "MDU6TGFiZWwzNDQ0NDUzNg==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Usage%20Question",
"name": "Usage Question",
"color": "0052cc",
"default": false,
"description": null
},
{
"id": 219960758,
"node_id": "MDU6TGFiZWwyMTk5NjA3NTg=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Needs%20Discussion",
"name": "Needs Discussion",
"color": "207de5",
"default": false,
"description": "Requires discussion from core team before further action"
},
{
"id": 1741841389,
"node_id": "MDU6TGFiZWwxNzQxODQxMzg5",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/API%20-%20Consistency",
"name": "API - Consistency",
"color": "b60205",
"default": false,
"description": "Internal Consistency of API/Behavior"
}
] | open | false | null | [] | null | 1 | 2024-09-05T08:36:56 | 2024-09-09T21:05:56 | null | NONE | null | null | null | ### Research
- [X] I have searched the [[pandas] tag](https://stackoverflow.com/questions/tagged/pandas) on StackOverflow for similar questions.
- [X] I have asked my usage related question on [StackOverflow](https://stackoverflow.com).
### Link to question on StackOverflow
https://stackoverflow.com/questions/72375976/odd-behavior-of-plotting-in-pandas
### Question about pandas
I had asked this question on SO some time ago but got no satisfactory answer.
Essentially the question (slightly improved wrt what i asked on SO) was, after having imported necessary packages:
```
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
```
why this code reuses the figure (so i end up with just one figure)
```
ser = pd.Series(np.random.randn(100))
fig = plt.figure()
ser.plot()
```
while this one does not (and i end up with two figures)
```
df = pd.DataFrame(np.random.randn(100,3))
fig = plt.figure()
df.plot()
```
?
Then i debugged a little bit and noticed that this is caused by the following two lines
```
if isinstance(data, ABCSeries):
kwargs["reuse_plot"] = True
```
in the PlotAccessor.__call__ in pandas/pandas/plotting/_core.py around line 990
Why do we need those two lines? What is the logic behind? Could we just remove them or set `kwargs["reuse_plot"]` always to `True`? I do not see the reason for the inconsistency.
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59716/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59716/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59715 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59715/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59715/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59715/events | https://github.com/pandas-dev/pandas/issues/59715 | 2,506,888,795 | I_kwDOAA0YD86VbBZb | 59,715 | QST: Consistently apply Welford Method and Kahan Summation in roll_xxx functions | {
"login": "kaixiongg",
"id": 43228252,
"node_id": "MDQ6VXNlcjQzMjI4MjUy",
"avatar_url": "https://avatars.githubusercontent.com/u/43228252?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/kaixiongg",
"html_url": "https://github.com/kaixiongg",
"followers_url": "https://api.github.com/users/kaixiongg/followers",
"following_url": "https://api.github.com/users/kaixiongg/following{/other_user}",
"gists_url": "https://api.github.com/users/kaixiongg/gists{/gist_id}",
"starred_url": "https://api.github.com/users/kaixiongg/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kaixiongg/subscriptions",
"organizations_url": "https://api.github.com/users/kaixiongg/orgs",
"repos_url": "https://api.github.com/users/kaixiongg/repos",
"events_url": "https://api.github.com/users/kaixiongg/events{/privacy}",
"received_events_url": "https://api.github.com/users/kaixiongg/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 8935311,
"node_id": "MDU6TGFiZWw4OTM1MzEx",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Performance",
"name": "Performance",
"color": "a10c02",
"default": false,
"description": "Memory or execution speed performance"
},
{
"id": 35818298,
"node_id": "MDU6TGFiZWwzNTgxODI5OA==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/API%20Design",
"name": "API Design",
"color": "AD7FA8",
"default": false,
"description": null
},
{
"id": 219960758,
"node_id": "MDU6TGFiZWwyMTk5NjA3NTg=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Needs%20Discussion",
"name": "Needs Discussion",
"color": "207de5",
"default": false,
"description": "Requires discussion from core team before further action"
},
{
"id": 2365504383,
"node_id": "MDU6TGFiZWwyMzY1NTA0Mzgz",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Reduction%20Operations",
"name": "Reduction Operations",
"color": "547c03",
"default": false,
"description": "sum, mean, min, max, etc."
}
] | open | false | null | [] | null | 7 | 2024-09-05T06:31:42 | 2024-09-22T13:55:56 | null | NONE | null | null | null | ### Research
- [X] I have searched the [[pandas] tag](https://stackoverflow.com/questions/tagged/pandas) on StackOverflow for similar questions.
- [X] I have asked my usage related question on [StackOverflow](https://stackoverflow.com).
### Link to question on StackOverflow
https://stackoverflow.com/questions/78951576/pandas-consistently-apply-welford-method-and-kahan-summation-in-roll-xxx-functi
### Question about pandas
For the following functions:
1.def nancorr
2.cdef void add_var
3.cdef void add_skew
4.cdef void add_mean
It appears that both the Welford method and Kahan summation are taken into account. However, for second-order functions like correlation and variance, only the Welford method is used without Kahan summation for the means (meanx or meany). For third-order functions like skewness, only Kahan summation for the naive one-pass algorithm is employed without using Welford.
My question is: How does the Pandas community decide which method to use for stable precision? If our goal is to achieve the highest possible stability, it seems that all these functions should utilize a combination of Welford and Kahan methods.
Could you please clarify the rationale behind these choices? | null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59715/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59715/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59711 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59711/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59711/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59711/events | https://github.com/pandas-dev/pandas/issues/59711 | 2,506,452,193 | I_kwDOAA0YD86VZWzh | 59,711 | BUG: converting null timedelta to int with astype() changes NaT to -9223372036854775808 | {
"login": "sfc-gh-mvashishtha",
"id": 149194323,
"node_id": "U_kgDOCOSGUw",
"avatar_url": "https://avatars.githubusercontent.com/u/149194323?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/sfc-gh-mvashishtha",
"html_url": "https://github.com/sfc-gh-mvashishtha",
"followers_url": "https://api.github.com/users/sfc-gh-mvashishtha/followers",
"following_url": "https://api.github.com/users/sfc-gh-mvashishtha/following{/other_user}",
"gists_url": "https://api.github.com/users/sfc-gh-mvashishtha/gists{/gist_id}",
"starred_url": "https://api.github.com/users/sfc-gh-mvashishtha/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sfc-gh-mvashishtha/subscriptions",
"organizations_url": "https://api.github.com/users/sfc-gh-mvashishtha/orgs",
"repos_url": "https://api.github.com/users/sfc-gh-mvashishtha/repos",
"events_url": "https://api.github.com/users/sfc-gh-mvashishtha/events{/privacy}",
"received_events_url": "https://api.github.com/users/sfc-gh-mvashishtha/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 76811,
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug",
"name": "Bug",
"color": "e10c02",
"default": false,
"description": null
},
{
"id": 2822342,
"node_id": "MDU6TGFiZWwyODIyMzQy",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Missing-data",
"name": "Missing-data",
"color": "d7e102",
"default": false,
"description": "np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate"
},
{
"id": 31404521,
"node_id": "MDU6TGFiZWwzMTQwNDUyMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Dtype%20Conversions",
"name": "Dtype Conversions",
"color": "e102d8",
"default": false,
"description": "Unexpected or buggy dtype conversions"
},
{
"id": 219960758,
"node_id": "MDU6TGFiZWwyMTk5NjA3NTg=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Needs%20Discussion",
"name": "Needs Discussion",
"color": "207de5",
"default": false,
"description": "Requires discussion from core team before further action"
}
] | open | false | null | [] | null | 1 | 2024-09-04T23:05:18 | 2024-09-07T12:26:07 | null | NONE | null | null | null | ### Pandas version checks
- [X] I have checked that this issue has not already been reported.
- [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas.
- [ ] I have confirmed this bug exists on the [main branch](https://pandas.pydata.org/docs/dev/getting_started/install.html#installing-the-development-version-of-pandas) of pandas.
### Reproducible Example
```python
import pandas as pd
print(pd.DataFrame([pd.Timedelta(1), None]).astype(int).iloc[1, 0])
```
### Issue Description
`astype(int)` converts missing values in a timedelta series to -9223372036854775808.
### Expected Behavior
should get `pd.DataFrame([1, None])` as the result.
### Installed Versions
<details>
```
INSTALLED VERSIONS
------------------
commit : d9cdd2ee5a58015ef6f4d15c7226110c9aab8140
python : 3.9.18.final.0
python-bits : 64
OS : Darwin
OS-release : 23.6.0
Version : Darwin Kernel Version 23.6.0: Mon Jul 29 21:13:04 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T6020
machine : arm64
processor : arm
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 2.2.2
numpy : 1.26.3
pytz : 2023.3.post1
dateutil : 2.8.2
setuptools : 68.2.2
pip : 23.3.1
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : None
IPython : 8.18.1
pandas_datareader : None
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : None
bottleneck : None
dataframe-api-compat : None
fastparquet : None
fsspec : None
gcsfs : None
matplotlib : None
numba : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pyreadstat : None
python-calamine : None
pyxlsb : None
s3fs : None
scipy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
zstandard : None
tzdata : 2023.4
qtpy : None
pyqt5 : None
```
</details>
| null | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59711/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59711/timeline | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/59698 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/59698/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/59698/comments | https://api.github.com/repos/pandas-dev/pandas/issues/59698/events | https://github.com/pandas-dev/pandas/issues/59698 | 2,503,534,390 | I_kwDOAA0YD86VOOc2 | 59,698 | DOC: fix docstring validation errors for pandas.Timedelta/pandas.TimedeltaIndex | {
"login": "natmokval",
"id": 91160475,
"node_id": "MDQ6VXNlcjkxMTYwNDc1",
"avatar_url": "https://avatars.githubusercontent.com/u/91160475?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/natmokval",
"html_url": "https://github.com/natmokval",
"followers_url": "https://api.github.com/users/natmokval/followers",
"following_url": "https://api.github.com/users/natmokval/following{/other_user}",
"gists_url": "https://api.github.com/users/natmokval/gists{/gist_id}",
"starred_url": "https://api.github.com/users/natmokval/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/natmokval/subscriptions",
"organizations_url": "https://api.github.com/users/natmokval/orgs",
"repos_url": "https://api.github.com/users/natmokval/repos",
"events_url": "https://api.github.com/users/natmokval/events{/privacy}",
"received_events_url": "https://api.github.com/users/natmokval/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 134699,
"node_id": "MDU6TGFiZWwxMzQ2OTk=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Docs",
"name": "Docs",
"color": "3465A4",
"default": false,
"description": null
},
{
"id": 106935113,
"node_id": "MDU6TGFiZWwxMDY5MzUxMTM=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Code%20Style",
"name": "Code Style",
"color": "eb6420",
"default": false,
"description": "Code style, linting, code_checks"
},
{
"id": 717120670,
"node_id": "MDU6TGFiZWw3MTcxMjA2NzA=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/good%20first%20issue",
"name": "good first issue",
"color": "0e8a16",
"default": true,
"description": null
}
] | open | false | {
"login": "TheRockStarDBA",
"id": 8247947,
"node_id": "MDQ6VXNlcjgyNDc5NDc=",
"avatar_url": "https://avatars.githubusercontent.com/u/8247947?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/TheRockStarDBA",
"html_url": "https://github.com/TheRockStarDBA",
"followers_url": "https://api.github.com/users/TheRockStarDBA/followers",
"following_url": "https://api.github.com/users/TheRockStarDBA/following{/other_user}",
"gists_url": "https://api.github.com/users/TheRockStarDBA/gists{/gist_id}",
"starred_url": "https://api.github.com/users/TheRockStarDBA/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/TheRockStarDBA/subscriptions",
"organizations_url": "https://api.github.com/users/TheRockStarDBA/orgs",
"repos_url": "https://api.github.com/users/TheRockStarDBA/repos",
"events_url": "https://api.github.com/users/TheRockStarDBA/events{/privacy}",
"received_events_url": "https://api.github.com/users/TheRockStarDBA/received_events",
"type": "User",
"site_admin": false
} | [
{
"login": "TheRockStarDBA",
"id": 8247947,
"node_id": "MDQ6VXNlcjgyNDc5NDc=",
"avatar_url": "https://avatars.githubusercontent.com/u/8247947?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/TheRockStarDBA",
"html_url": "https://github.com/TheRockStarDBA",
"followers_url": "https://api.github.com/users/TheRockStarDBA/followers",
"following_url": "https://api.github.com/users/TheRockStarDBA/following{/other_user}",
"gists_url": "https://api.github.com/users/TheRockStarDBA/gists{/gist_id}",
"starred_url": "https://api.github.com/users/TheRockStarDBA/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/TheRockStarDBA/subscriptions",
"organizations_url": "https://api.github.com/users/TheRockStarDBA/orgs",
"repos_url": "https://api.github.com/users/TheRockStarDBA/repos",
"events_url": "https://api.github.com/users/TheRockStarDBA/events{/privacy}",
"received_events_url": "https://api.github.com/users/TheRockStarDBA/received_events",
"type": "User",
"site_admin": false
}
] | null | 19 | 2024-09-03T18:44:37 | 2024-10-06T10:15:20 | null | CONTRIBUTOR | null | null | null | follow up on issues https://github.com/pandas-dev/pandas/issues/56804, https://github.com/pandas-dev/pandas/issues/59458 and https://github.com/pandas-dev/pandas/issues/58063
pandas has a script for validating docstrings:
https://github.com/pandas-dev/pandas/blob/2244402942dbd30bdf367ceae49937c179e42bcb/ci/code_checks.sh#L112-L128
Currently, some methods fail docstring validation check.
The task here is:
* take 2-4 methods
* run: `scripts/validate_docstrings.py <method-name>`
* run `pytest pandas/tests/scalar/test_nat.py::test_nat_doc_strings`
* fix the docstrings according to whatever error is reported
* remove those methods from `code_checks.sh` script
* commit, push, open pull request
Example:
```
scripts/validate_docstrings.py pandas.Timedelta.ceil
```
pandas.Timedelta.ceil fails with the SA01 and ES01 errors
```
################################################################################
################################## Validation ##################################
################################################################################
2 Errors found for `pandas.Timedelta.ceil`:
ES01 No extended summary found
SA01 See Also section not found
```
Please don't comment `take` as multiple people can work on this issue. You also don't need to ask for permission to work on this, just comment on which methods are you going to work.
If you're new contributor, please check the [contributing guide](https://pandas.pydata.org/docs/dev/development/contributing.html)
| {
"login": "mroeschke",
"id": 10647082,
"node_id": "MDQ6VXNlcjEwNjQ3MDgy",
"avatar_url": "https://avatars.githubusercontent.com/u/10647082?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/mroeschke",
"html_url": "https://github.com/mroeschke",
"followers_url": "https://api.github.com/users/mroeschke/followers",
"following_url": "https://api.github.com/users/mroeschke/following{/other_user}",
"gists_url": "https://api.github.com/users/mroeschke/gists{/gist_id}",
"starred_url": "https://api.github.com/users/mroeschke/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mroeschke/subscriptions",
"organizations_url": "https://api.github.com/users/mroeschke/orgs",
"repos_url": "https://api.github.com/users/mroeschke/repos",
"events_url": "https://api.github.com/users/mroeschke/events{/privacy}",
"received_events_url": "https://api.github.com/users/mroeschke/received_events",
"type": "User",
"site_admin": false
} | {
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/59698/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/pandas-dev/pandas/issues/59698/timeline | null | reopened |
Subsets and Splits