Skip to content

NestedFrame.__setitem__("new_nested.x", flat_values) repeats values for non-unique index #324

@hombit

Description

@hombit

Bug report

from nested_pandas.datasets import generate_data

nf = generate_data(5, 3)
nf['new.flux'] = nf['nested.flux']
print(nf)
          a  ...                               new
0  0.768677  ...  [{flux: -85.021725}; …] (6 rows)
0  0.618566  ...  [{flux: -85.021725}; …] (6 rows)
1  0.308658  ...  [{flux: -16.160369}; …] (9 rows)
1  0.612433  ...  [{flux: -16.160369}; …] (9 rows)
1  0.332888  ...  [{flux: -16.160369}; …] (9 rows)

Note 6 and 9 nested rows instead of 3

Before submitting
Please check the following:

  • I have described the situation in which the bug arose, including what code was executed, information about my environment, and any applicable data others will need to reproduce the problem.
  • I have included available evidence of the unexpected behavior (including error messages, screenshots, and/or plots) as well as a description of what I expected instead.
  • If I have a solution in mind, I have provided an explanation and/or pseudocode and/or task list.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions