Skip to content
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

Cannot alter index of frames with cells that contain lists #359

Open
stestagg opened this issue Dec 19, 2024 · 0 comments
Open

Cannot alter index of frames with cells that contain lists #359

stestagg opened this issue Dec 19, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@stestagg
Copy link

stestagg commented Dec 19, 2024

Type: Bug

Behaviour

Expected vs. Actual

Index modification of frames works the same for both frames with scalar data, and frames that have cells with embedded lists/arrays.

Steps to reproduce:

  1. Create two frames:
import pandas as pd
df1 = pd.DataFrame({
    'a': [2, 3, 1],    
    'b': [1, 2, 3]
})
df2 = pd.DataFrame({
    'a': [[1,2], [2,3], [1, 3]],
    'b': [1, 2, 3]
})

This custom operation works:

df1.set_index('b', inplace=True)  # works

This does not:

df2.set_index('b', inplace=True)

Error message is:
Failed to update data frame: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

Diagnostic data

  • Jupyter extension version: 2025.1.2024121901
  • Python extension version: 2024.23.2024121901
  • .NET Install Tool for Extension Authors extension version: Not installed
  • Python package dependencies:
{
  "installed": {
    "pandas": "2.2.3",
    "pyarrow": "18.1.0"
  },
  "required": {
    "pandas": "1.2.0"
  },
  "unsatisfied": []
}
  • Entrypoint: JupyterNotebookToolbar
  • Active mode: dataWrangler

Extension version: 1.15.1
VS Code version: Code - Insiders 1.97.0-insider (acd32b17b837b05a64275c297949753df46dbe6d, 2024-12-19T05:04:10.650Z)
OS version: Darwin arm64 24.2.0
Modes:

System Info
Item Value
CPUs Apple M1 Ultra (20 x 2400)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) 2, 3, 4
Memory (System) 128.00GB (0.45GB free)
Process Argv --crash-reporter-id f31023b9-8424-4c34-8ff1-b3c2f173ab66
Screen Reader no
VM 0%
A/B Experiments
vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
vsc_aacf:30263846
vscod805:30301674
vsaa593cf:30376535
py29gd2263:31024238
c4g48928:30535728
a9j8j154:30646983
962ge761:30841072
pythonnoceb:30776497
dsvsc014:30777825
dsvsc015:30821418
pythonmypyd1:30859725
h48ei257:31000450
pythontbext0:30879054
cppperfnew:30980852
pythonait:30973460
dvdeprecation:31040973
dwnewjupytercf:31046870
nativerepl1:31134653
pythonrstrctxt:31093868
nativeloc1:31118317
cf971741:31144450
e80f6927:31120813
iacca1:31150324
notype1:31143044
dwcopilot:31158714
h409b430:31177054
5b1c1929:31184661
6074i472:31201624

@pwang347 pwang347 added the bug Something isn't working label Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants