Skip to content

Commit

Permalink
Typing changes
Browse files Browse the repository at this point in the history
  • Loading branch information
wilsonbb committed Apr 18, 2024
1 parent b2d0da4 commit 4ca4a1a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/nested_pandas/nestedframe/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ def dropna(
)
return new_df

def reduce(self, func, *args, **kwargs) -> pd.DataFrame:
def reduce(self, func, *args, **kwargs) -> NestedFrame:
"""
Takes a function and applies it to each top-level row of the NestedFrame.
Expand Down Expand Up @@ -368,12 +368,12 @@ def my_sum(col1, col2):
col = arg.split(".")[-1]
requested_columns.append((layer, col))

# We require the first *args to be the columns to apply the function to so iterated
# We require the first *args to be the columns to apply the function to
if not requested_columns:
raise ValueError("No columns in `*args` specified to apply function to")

# The remaining args are the extra arguments to the function other than columns
extra_args: tuple[Any, ...] = []
extra_args: List[Any] = []
if len(requested_columns) < len(args):
extra_args = args[len(requested_columns) :]

Expand Down

0 comments on commit 4ca4a1a

Please sign in to comment.