Skip to content

Python panda test failed. #3622

@trivialfis

Description

@trivialfis

commit: 4912c1f
Python: 3.6 vertualenv
pandas: 0.23.4
numpy: 1.15.0

Failed in this test:

assert cv.columns.equals(exp)

The actual result has 'train-' sorted before 'test-'.

I tried to go into training code and found this:

for k, v in sorted(cvmap.items(), key=lambda x: (x[0].startswith('test'), x[0])):

If x.startswith('test') is True, it will have greater value than False, sorted is meant to sort stuff in ascending order so key starts with "test" will be sorted after key starts with "train", which is the opposite of expected result.

It's not quite clear to me what these code do, so I could be way wrong. And I don't know why Travis didn't fail, I cleaned my virtualenv to ensure nothing else gets in the way.

Any insight? :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions