Skip to content

Conversation

@dsaxton
Copy link
Contributor

@dsaxton dsaxton commented Mar 10, 2020

@WillAyd
Copy link
Member

WillAyd commented Mar 11, 2020

Hmm how is this type of construction actually useful? If anything this should probably just raise

@WillAyd WillAyd added the Constructors Series/DataFrame/Index/pd.array Constructors label Mar 11, 2020
@dsaxton
Copy link
Contributor Author

dsaxton commented Mar 11, 2020

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 Series case so makes sense it would here too (or could treat sets as singletons, although that seems even less useful?)

@WillAyd
Copy link
Member

WillAyd commented Mar 11, 2020

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

# 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):
Copy link
Contributor

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

Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@jreback jreback added this to the 1.1 milestone Mar 15, 2020
@jreback jreback added the Bug label Mar 15, 2020
@jreback jreback merged commit 74f6579 into pandas-dev:master Mar 15, 2020
@jreback
Copy link
Contributor

jreback commented Mar 15, 2020

thanks @dsaxton

@dsaxton dsaxton deleted the set-construct branch March 15, 2020 00:42
SeeminSyed pushed a commit to CSCD01-team01/pandas that referenced this pull request Mar 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Constructors Series/DataFrame/Index/pd.array Constructors

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Creating a column with a set replicates the set n times

4 participants