-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: Don't multiply sets during construction #32594
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
Conversation
Hmm how is this type of construction actually useful? If anything this should probably just raise |
Yeah, I could see that too. Looks like it does raise in the |
If Series raises then I think that is even more motivation to raise here; this seems more likely to be a programmer error than intent |
pandas/core/construction.py
Outdated
@@ -446,6 +446,8 @@ def sanitize_array( | |||
# GH#16804 | |||
arr = np.arange(data.start, data.stop, data.step, dtype="int64") | |||
subarr = _try_cast(arr, dtype, copy, raise_cast_failure) | |||
elif isinstance(data, set): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you use abc.Set
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm
thanks @dsaxton |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff