Skip to content

Error in cutTreeHybrid #5

@scruwe

Description

@scruwe

if UnlabeledExist:
if len(Sizes) > 1:
SizeRank = np.append(1, rankdata(-Sizes[1:len(Sizes)], method="ordinal")+1)
else:
SizeRank = 1
OrdNumLabs = SizeRank[NumLabs - 1]
else:
SizeRank = rankdata(-Sizes[np.arange(len(Sizes))], method="ordinal")
OrdNumLabs = SizeRank[NumLabs - 2]

In this code you are setting SizeRank to an array or an integer type based on the condition. The next statement refers to SizeRank with a subscript. We are falling into the path where SizeRank is set to 1 and are receiving a you cannot subscript an integer error. Types for a variable should be consistent. How shoud SizeRank be initialized if len(Sizes) is not greater than 1.

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