Skip to content

Commit 7c24ed8

Browse files
authored
change "if weights is not None" to "if weights"
1 parent 800e99b commit 7c24ed8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pandas/core/groupby/groupby.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1539,7 +1539,7 @@ def sample(groupby_result, size=None, frac=None, replace=False, weights=None):
15391539
if(size==len(groups_dictionary) or frac ==1):
15401540
raise Warning("Random sample equals to the given groupbt: the inplut size is the same as the size of the input group")
15411541

1542-
if weights is not None:
1542+
if weights:
15431543
#weights is a list
15441544
if(len(weights) != len(groups_dictionary.keys())):
15451545
raise ValueError("Weights and axis to be sampled must be the same length")

0 commit comments

Comments
 (0)