Skip to content

Commit 8fb8bf0

Browse files
update code sample for pandas-dev#37415
1 parent 3444da4 commit 8fb8bf0

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

bisect/37415.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,10 @@
22
print(pd.__version__)
33
df = pd.DataFrame({'a': [1, 1, 1, 2, 2], 'b': [1, 2, 3, 4, 5]})
44
df['b'] = df['b'].astype(pd.Int32Dtype())
5-
res = df.groupby('a').agg('std')
6-
print(res)
5+
try:
6+
res = df.groupby('a').agg('std')
7+
except TypeError:
8+
# 1.0.0rc raised TypeError: cannot safely cast non-equivalent float64 to int32)
9+
pass
10+
else:
11+
print(res)

0 commit comments

Comments
 (0)