Skip to content

Commit b4b0ecb

Browse files
code sample for pandas-dev#38774
1 parent aafd7a4 commit b4b0ecb

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

bisect/38774.py

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import numpy as np
2+
import pandas as pd
3+
4+
print(pd.__version__)
5+
6+
idx = pd.MultiIndex.from_arrays(
7+
[[str(i) for i in range(100)], np.random.choice(["A", "B"], size=(100,))],
8+
names=["a", "b"],
9+
)
10+
11+
data_dict = dict((str(i), np.random.rand(100)) for i in range(10))
12+
data_dict["string"] = [str(i) for i in range(100)]
13+
data_dict["bool"] = np.random.choice([True, False], (100,))
14+
data = pd.DataFrame(data_dict, index=idx)
15+
16+
result = data.sem(level=1)
17+
print(result)

0 commit comments

Comments
 (0)