Skip to content

ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 2 dimensions. The detected shape was (184526, 5) + inhomogeneo #9

@sicotteh

Description

@sicotteh

I ran into an error running on exome data. in the preprocess_sample.py

Traceback (most recent call last):
File "/fslustre/qhs/ext_sicotte_hugues_mayo_edu/projects/sinha/ecole_cnv/ECOLE-0.2/scripts/preprocess_sample.py", line 101, in
labeled_data = np.asarray(labeled_data)
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 2 dimensions. The detected shape was (184526, 5) + inhomogeneo
us part.

The issue is of a variable length string as the sample name.
The fix was to change the last few lines.. in Bold are the code changes.
The “next” script in the pipeline works after that change too.

labeled_data = np.asarray(labeled_data, dtype=object) # FIXED
np.save(
os.path.join(output_path, sample_name + "_labeled_data.npy"),
labeled_data,
allow_pickle=True # FIXED
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions