Skip to content
This repository was archived by the owner on Feb 23, 2023. It is now read-only.

Commit b204958

Browse files
committed
Fix groupby-resample KeyError (pandas-dev#50840) by adding None check.
1 parent a68c947 commit b204958

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pandas/core/resample.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1202,7 +1202,7 @@ def _gotitem(self, key, ndim, subset=None):
12021202

12031203
# Try to select from a DataFrame, falling back to a Series
12041204
try:
1205-
if isinstance(key, list) and self.key not in key:
1205+
if isinstance(key, list) and self.key not in key and self.key is not None:
12061206
key.append(self.key)
12071207
groupby = self._groupby[key]
12081208
except IndexError:

0 commit comments

Comments
 (0)