Skip to content

Commit 19a3c5f

Browse files
code sample for pandas-dev#42747
1 parent b7ac784 commit 19a3c5f

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

bisect/42747.py

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# BUG: freq attribute is None after set_index #42747
2+
3+
import numpy as np
4+
import pandas as pd
5+
6+
print(pd.__version__)
7+
8+
df = pd.DataFrame({"datetime": pd.date_range("1/1/1", periods=20, freq="H", tz="UTC")})
9+
df.set_index("datetime", inplace=True)
10+
11+
result = df.index.freq
12+
print(result)
13+
assert result == "H", result

0 commit comments

Comments
 (0)