Skip to content

Commit 2796b0d

Browse files
author
MarcoGorelli
committed
Merge remote-tracking branch 'upstream/main' into column-getitem-and-len
2 parents ce443f8 + baa605d commit 2796b0d

File tree

3 files changed

+58
-15
lines changed

3 files changed

+58
-15
lines changed

.github/workflows/preview.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ jobs:
1111
uses: larsoner/circleci-artifacts-redirector-action@master
1212
with:
1313
repo-token: ${{ secrets.GITHUB_TOKEN }}
14+
api-token: ${{ secrets.CIRCLE_TOKEN }}
1415
artifact-path: 0/build/draft/index.html
1516
circleci-jobs: build_page
1617
job-title: Check the rendered docs here!

spec/API_specification/dataframe_api/dataframe_object.py

Lines changed: 54 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ def dataframe(self) -> object:
1919
If a library only implements the Standard, then this can return `self`.
2020
"""
2121
...
22+
23+
def shape(self) -> tuple[int, int]:
24+
"""
25+
Return number of rows and number of columns.
26+
"""
2227

2328
def groupby(self, keys: Sequence[str], /) -> GroupBy:
2429
"""
@@ -174,21 +179,6 @@ def drop_column(self, label: str) -> DataFrame:
174179
"""
175180
...
176181

177-
def set_column(self, label: str, value: Column) -> DataFrame:
178-
"""
179-
Add or replace a column.
180-
181-
Parameters
182-
----------
183-
label : str
184-
value : Column
185-
186-
Returns
187-
-------
188-
DataFrame
189-
"""
190-
...
191-
192182
def rename_columns(self, mapping: Mapping[str, str]) -> DataFrame:
193183
"""
194184
Rename columns.
@@ -452,6 +442,17 @@ def __divmod__(self, other: DataFrame | Scalar) -> tuple[DataFrame, DataFrame]:
452442
"""
453443
...
454444

445+
def __invert__(self) -> DataFrame:
446+
"""
447+
Invert truthiness of (boolean) elements.
448+
449+
Raises
450+
------
451+
ValueError
452+
If any of the DataFrame's columns is not boolean.
453+
"""
454+
...
455+
455456
def __iter__(self) -> NoReturn:
456457
"""
457458
Iterate over elements.
@@ -467,12 +468,50 @@ def __iter__(self) -> NoReturn:
467468
def any(self, skipna: bool = True) -> DataFrame:
468469
"""
469470
Reduction returns a 1-row DataFrame.
471+
472+
Raises
473+
------
474+
ValueError
475+
If any of the DataFrame's columns is not boolean.
470476
"""
471477
...
472478

473479
def all(self, skipna: bool = True) -> DataFrame:
474480
"""
475481
Reduction returns a 1-row DataFrame.
482+
483+
Raises
484+
------
485+
ValueError
486+
If any of the DataFrame's columns is not boolean.
487+
"""
488+
...
489+
490+
def any_rowwise(self, skipna: bool = True) -> Column:
491+
"""
492+
Reduction returns a Column.
493+
494+
Differs from ``DataFrame.any`` and that the reduction happens
495+
for each row, rather than for each column.
496+
497+
Raises
498+
------
499+
ValueError
500+
If any of the DataFrame's columns is not boolean.
501+
"""
502+
...
503+
504+
def all_rowwise(self, skipna: bool = True) -> Column:
505+
"""
506+
Reduction returns a Column.
507+
508+
Differs from ``DataFrame.all`` and that the reduction happens
509+
for each row, rather than for each column.
510+
511+
Raises
512+
------
513+
ValueError
514+
If any of the DataFrame's columns is not boolean.
476515
"""
477516
...
478517

spec/API_specification/dataframe_api/groupby_object.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,6 @@ def std(self, skipna: bool = True) -> "DataFrame":
3434

3535
def var(self, skipna: bool = True) -> "DataFrame":
3636
...
37+
38+
def size(self) -> "DataFrame":
39+
...

0 commit comments

Comments
 (0)