Skip to content

Error in cutTreeHybrid #5

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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