lincc-frameworks / lincc-frameworks/nested-pandas

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

Open
#324 2 comments 0 reactions 0 assignees View on GitHub
bug LSDB question
Dominant language
Python
Stars
26
Forks
8
Avg merge
2d 2h
Merged PRs (30d)
9

Description

**Bug report**

```python
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:

- [x] 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.
- [x] 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.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by running the reproduction using generate_data and the NestedFrame.__setitem__("new.flux", flat_values) assignment. Trace how the non-unique outer index is handled, then verify that each outer row receives the expected three nested rows rather than repeated values.

Written by the indexing model from the issue text.

Assessment

Tech stack
pandas, python
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.