Skip to content

add Column.from_sequence #148

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

Merged
merged 2 commits into from
Apr 27, 2023
Merged

Conversation

MarcoGorelli
Copy link
Contributor

closes #121

Copy link
Member

@rgommers rgommers left a comment

Choose a reason for hiding this comment

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

Thanks Marco, this looks good. The one important thing that I think is missing is this (from gh-121): "Each element of input sequences must be of that dtype."

I believe the idea was that it should be the relevant Python scalar type, or something that duck types that. So for any integer type, it's int (or an object that has __int__), for datetimes, datetime.datetime instances, etc. EDIT: for categoricals, the underlying dict type

@rgommers
Copy link
Member

rgommers commented Apr 26, 2023

(or an object that has __int__)

and no need to describe that, I'm doing that in a separate page, so it can be linked to. EDIT: that's gh-153

@rgommers
Copy link
Member

The one important thing that I think is missing is this (from gh-121): "Each element of input sequences must be of that dtype."

I guess if dtype is explicitly specified, this is currently already implicit if you append "or coercible to that dtype".

@rgommers rgommers force-pushed the column-from-array branch from 69a0105 to 1b1b9ef Compare April 27, 2023 11:02
@rgommers rgommers merged commit b2d977c into data-apis:main Apr 27, 2023
``dtype``, the corresponding Python builtin scalar type, or
coercible to that Python scalar type.
dtype : str
Dtype of result. Must be specified.
Copy link
Member

Choose a reason for hiding this comment

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

Should we start listing the possible values for the strings to specify dtypes? (for example, we don't necessarily want to support all variations of the same dtype that numpy supports?)

Copy link
Member

Choose a reason for hiding this comment

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

Ohhhh that is a good catch - this is the very first dtype keyword. There's multiple ways we could go there, this is important enough to open a separate issue about. Let me do so now.

Copy link
Member

Choose a reason for hiding this comment

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

done in gh-155

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

Successfully merging this pull request may close these issues.

Column constructor
4 participants