Skip to content

BUG: frame_length_0[key] = nonempty_frame raises ValueError #38831

Closed
@jbrockmendel

Description

@jbrockmendel
df = pd.DataFrame(columns=["A", "B"])

other = pd.DataFrame({"B": [1, 2]})

>>> df["B"] = other
ValueError: Cannot set a frame with no defined index and a value that cannot be converted to a Series

>>> df[["B"]] = other   # <-- works as expected

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugIndexingRelated to indexing on series/frames, not to indexes themselves

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions