Skip to content

remove names from dataframe_from_2d_array #302

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
Oct 27, 2023
Merged
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
5 changes: 2 additions & 3 deletions spec/API_specification/dataframe_api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def column_from_1d_array(array: Any, *, dtype: DType, name: str = '') -> Column:
"""
...

def dataframe_from_2d_array(array: Any, *, names: Sequence[str], dtypes: Mapping[str, Any]) -> DataFrame:
def dataframe_from_2d_array(array: Any, *, dtypes: Mapping[str, Any]) -> DataFrame:
Copy link
Collaborator

@kkraus14 kkraus14 Oct 27, 2023

Choose a reason for hiding this comment

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

Does Mapping guarantee ordering? As far as I can tell it only guarantees that __getitem__, __len__, and __iter__ are supported, but doesn't guarantee any specific order for __iter__?

Not sure if this is actually an issue in practice though. Worst case we could dictate Dict instead of Mapping here?

"""
Construct DataFrame from 2D array.

Expand All @@ -149,10 +149,9 @@ def dataframe_from_2d_array(array: Any, *, names: Sequence[str], dtypes: Mapping
----------
array : array
array-API compliant 2D array
names : Sequence[str]
Names to give columns. Must be the same length as ``array.shape[1]``.
dtypes : Mapping[str, DType]
Dtype of each column. Must be the same length as ``array.shape[1]``.
Keys determine column names.

Returns
-------
Expand Down