Skip to content

(x + 1) % 1 inside test_multi.py #19092

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Mofef opened this issue Jan 5, 2018 · 5 comments
Closed

(x + 1) % 1 inside test_multi.py #19092

Mofef opened this issue Jan 5, 2018 · 5 comments
Labels
MultiIndex Testing pandas testing functions or related to the test suite

Comments

@Mofef
Copy link
Contributor

Mofef commented Jan 5, 2018

Code Sample, a copy-pastable example if possible

major_labels = [(x + 1) % 3 for x in major_labels]
minor_labels = [(x + 1) % 1 for x in minor_labels]

Problem description

I assume this is supposed to shift the labels cyclically by one. Then % 4 and % 2 should be used. Otherwise its at least weird to write (x + 1) % 1 instead of 0.

@jreback
Copy link
Contributor

jreback commented Jan 5, 2018

do you have an example where this is incorrect?

@Mofef
Copy link
Contributor Author

Mofef commented Jan 5, 2018

No, i just wanted to raise the attention in case this is not on purpose.

@jreback
Copy link
Contributor

jreback commented Jan 5, 2018

I am still not clear on what the issue is? are you saying the test is wrong? you can certainly enhance it if you want

@gfyoung
Copy link
Member

gfyoung commented Jan 6, 2018

@jreback : @Mofef is saying that (x + 1) % 1 seems a little weird given that it always should return 0.

@gfyoung gfyoung closed this as completed Jan 6, 2018
@gfyoung gfyoung reopened this Jan 6, 2018
@gfyoung gfyoung added MultiIndex Testing pandas testing functions or related to the test suite labels Jan 6, 2018
@jreback jreback closed this as completed Jan 6, 2018
@jreback
Copy link
Contributor

jreback commented Jan 6, 2018

this is fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MultiIndex Testing pandas testing functions or related to the test suite
Projects
None yet
Development

No branches or pull requests

3 participants