Skip to content

Commit b97ba2a

Browse files
code sample for pandas-dev#42719
1 parent 1029648 commit b97ba2a

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

bisect/42719.py

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# BUG: TypeError when shifting DataFrame created by concatenation of slices and fills with values #42719
2+
3+
import numpy as np
4+
import pandas as pd
5+
6+
print(pd.__version__)
7+
8+
npa = np.random.RandomState(0).randint(1000, size=(20, 8))
9+
df = pd.DataFrame(npa, columns=[f"c{i}" for i in range(8)])
10+
11+
df1 = df.iloc[:6, 3:5]
12+
df2 = df.iloc[:6, 6:8]
13+
df = pd.concat([df1, df2], axis=1)
14+
15+
result = df.shift(periods=2, axis=1, freq=None, fill_value=0)
16+
print(result)

0 commit comments

Comments
 (0)