Skip to content

Commit 9f5fff4

Browse files
code sample for pandas-dev#45802
1 parent 5777057 commit 9f5fff4

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

bisect/45802.py

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# BUG: Type error in groupby.transform(interpolate) #45802
2+
3+
import numpy as np
4+
import pandas as pd
5+
6+
np.random.seed(500)
7+
test_df = pd.DataFrame(
8+
{
9+
"a": np.random.randint(low=0, high=1000, size=10000),
10+
"b": np.random.choice(
11+
[1, 2, 4, 7, np.nan], size=10000, p=([0.2475] * 4 + [0.01])
12+
),
13+
}
14+
)
15+
grp = test_df.groupby("a")
16+
17+
result = grp.transform(pd.DataFrame.interpolate)
18+
print(result)

0 commit comments

Comments
 (0)