Skip to content

CLN: groupby #29626

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

Closed
wants to merge 9 commits into from
Closed
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
Prev Previous commit
Next Next commit
dict->Dict
  • Loading branch information
jbrockmendel committed Nov 17, 2019
commit 2c67e86785b3c4cbf7a9b5ac4adbdaaaaf7e504c
6 changes: 3 additions & 3 deletions pandas/core/groupby/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from functools import partial
from textwrap import dedent
import typing
from typing import Any, Callable, FrozenSet, Iterable, Sequence, Type, Union, cast
from typing import Any, Callable, Dict, FrozenSet, Iterable, Sequence, Type, Union, cast
import warnings

import numpy as np
Expand Down Expand Up @@ -383,8 +383,8 @@ def _get_index() -> Index:
result = Series(data=values, index=_get_index(), name=self._selection_name)
return self._reindex_output(result)

def _aggregate_named(self, func, *args, **kwargs) -> dict:
result = {} # type: dict
def _aggregate_named(self, func, *args, **kwargs) -> Dict:
result = {} # type: Dict
Copy link
Contributor

Choose a reason for hiding this comment

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

can use the new style of typing now, e.g. result: Dict = {}, though odd that mypy can't infer that. better to be even specific, Dict[str, ]

Copy link
Member

Choose a reason for hiding this comment

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

Just FYI mypy will always complain for an empty container creation as it can't infer the subtypes


for name, group in self:
group.name = name
Expand Down