Skip to content

Pandas error durind _find_elite #2

@fpartika

Description

@fpartika

At first congrats for the initiative, your implementation is brilliant!

I'm getting sporadically the same error in line:

weights_sorted = pd.Series(self._generation, index=scores).sort_index(ascending=False)

that is triggered from inside the series.py inside pandas, at the code:

        elif is_list_like(data):

            # a scalar numpy array is list-like but doesn't
            # have a proper length
            try:
                if len(index) != len(data):
                    raise ValueError(
                        f"Length of passed values is {len(data)}, "
                        f"index implies {len(index)}."

What I noticed is that this only occurs when index become (for some reason) a pandas Multindex instead of a list of arrays, it raises the following error message:

ValueError: Length of passed values is 14, index implies 1.

Thanks!

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