We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f3ed08d commit 2973996Copy full SHA for 2973996
bisect/47039.py
@@ -0,0 +1,19 @@
1
+# BUG: DataFrame.shift shows different behavior for axis=1 when freq is specified #47039
2
+
3
+import numpy as np
4
+import pandas as pd
5
6
+print(pd.__version__)
7
8
+rs = np.random.RandomState(0)
9
10
+raw = pd.DataFrame(
11
+ rs.randint(1000, size=(10, 8)), columns=["col" + str(i + 1) for i in range(8)]
12
+)
13
+raw.index = pd.date_range("2020-1-1", periods=10)
14
+raw.columns = pd.date_range("2020-3-1", periods=8)
15
+result = raw.shift(periods=2, freq="D", axis=1)
16
+print(result)
17
18
+expected = raw.shift(periods=2, freq="D", axis=1, fill_value=0)
19
+pd.testing.assert_frame_equal(result, expected)
0 commit comments