Skip to content

Autogenerate Transformation Instructions Not Working #7

Description

@atwine
Image

Error:

ValueError: can only convert an array of size 1 to a Python scalar

File "/app/app/app.py", line 68, in <module>
    map_study(study, variables_status, show_about, original_order, relational_mode, enable_transformations)
File "/app/app/components/map_study.py", line 275, in map_study
    st.session_state.transformation_instructions[variable_to_map] = generate_transformations(split_var_confidence(mapped_variable)[0], variable_to_map, example_data, st.session_state.transformation_instructions.get(variable_to_map, ''), codebook_var_df)
                                                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/app/components/generate_transformations.py", line 149, in generate_transformations
    categories = codebook['Categories'].item()
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/venv/lib/python3.11/site-packages/pandas/core/base.py", line 422, in item
    raise ValueError("can only convert an array of size 1 to a Python scalar")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions