Skip to content

Commit 876fa63

Browse files
code sample for pandas-dev#46904
1 parent 330a3b5 commit 876fa63

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

bisect/46904.py

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# BUG: aggregate function on transposed resampled data frame raises ValueError #46904
2+
3+
import pandas as pd
4+
5+
print(pd.__version__)
6+
7+
DIM = 3
8+
now = pd.Timestamp.now()
9+
# Create data frame.
10+
data = [[i + j for i in range(DIM)] for j in range(DIM)]
11+
columns = [now + pd.DateOffset(i) for i in range(DIM)]
12+
df = pd.DataFrame(data=data, columns=columns)
13+
14+
# Calculate mean/min/max/sum per month.
15+
try:
16+
df.resample("M", axis=1).aggregate(["mean", "min", "max", "sum"])
17+
except NotImplementedError as e:
18+
print(e)

0 commit comments

Comments
 (0)