Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

BUG: Fix DataFrame constructor misclassification of array-like with 'name' attribute (#61443) #61451

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 19, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Apply pre-commit fixes: isort and remove unused type ignore
  • Loading branch information
iabhi4 committed May 18, 2025
commit 9687457576142bee476e3c3d5a49a7397e6d8e40
10 changes: 5 additions & 5 deletions 10 pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,14 @@
BaseMaskedDtype,
ExtensionDtype,
)
from pandas.core.dtypes.generic import (
ABCIndex,
ABCSeries,
)
from pandas.core.dtypes.missing import (
isna,
notna,
)
from pandas.core.dtypes.generic import (
ABCSeries,
ABCIndex
)

from pandas.core import (
algorithms,
Expand Down Expand Up @@ -804,7 +804,7 @@ def __init__(
mgr = dict_to_mgr(
# error: Item "ndarray" of "Union[ndarray, Series, Index]" has no
# attribute "name"
{data.name: data}, # type: ignore[union-attr]
{data.name: data},
index,
columns,
dtype=dtype,
Expand Down
1 change: 1 addition & 0 deletions 1 pandas/tests/frame/test_constructors.py
Original file line number Diff line number Diff line change
Expand Up @@ -2792,6 +2792,7 @@ def __new__(cls, input_array):
expected = DataFrame(np.eye(3))
tm.assert_frame_equal(df, expected)


class TestDataFrameConstructorIndexInference:
def test_frame_from_dict_of_series_overlapping_monthly_period_indexes(self):
rng1 = pd.period_range("1/1/1999", "1/1/2012", freq="M")
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.