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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion spec/API_specification/dataframe_api/column_object.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,25 @@
from __future__ import annotations

from typing import Sequence

from ._types import dtype

class Column:
pass
@classmethod
def from_sequence(cls, sequence: Sequence[object], dtype: dtype) -> Column:
"""
Construct Column from sequence of elements.

Parameters
----------
sequence : Sequence[object]
Sequence of elements. Each element must be of the specified
``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


Returns
-------
Column
"""