Skip to content

move from_sequence to namespace #164

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 4 commits into from
May 11, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
24 changes: 24 additions & 0 deletions spec/API_specification/dataframe_api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,38 @@
"""
Function stubs and API documentation for the DataFrame API standard.
"""
from __future__ import annotations

from typing import Sequence

from .column_object import *
from .dataframe_object import *
from .groupby_object import *

from ._types import dtype


__dataframe_api_version__: str = "YYYY.MM"
"""
String representing the version of the DataFrame API specification to which the
conforming implementation adheres.
"""

def from_sequence(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.

Returns
-------
Column
"""
...
20 changes: 0 additions & 20 deletions spec/API_specification/dataframe_api/column_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,6 @@ class Column:
constructor functions or an already-created dataframe object retrieved via

"""
@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.

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

def __len__(self) -> int:
"""
Return the number of rows.
Expand Down