Skip to content

MAINT: While to For loop #16852

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
wants to merge 1 commit into from

Conversation

archsyscall
Copy link
Contributor

In this case, for loop looks better than while loop.

Thanks!

@seberg
Copy link
Member

seberg commented Jul 13, 2020

The code is weird, I admit, but if I try this:

np.ma.extras.flatten_inplace([[1, 4], [2, 5], [3, 6]])

The result is not correct after this change, so I think the while loop is necessary here, because the sequence length can change.

@archsyscall
Copy link
Contributor Author

Your right. My code is incorrect.

@eric-wieser
Copy link
Member

It's interesting that flatten_inplace was always used by the masked version of this function (61f9f6d), but never the unmasked version.

At some point we should revisit #8511, which would remove the final caller.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants