1 QuarterEnd.is_month_start()
1 import pandas as pd
2
3 offset = pd.tseries.offsets.QuarterEnd()
4
5 tstamp = pd.Timestamp(2022, 6, 1)
6 res = offset.is_month_start(tstamp)
7 print(f'Timestamp at month start :{res}')
8
9 tstamp1 = pd.Timestamp(2022, 4, 14)
10 res1 = offset.is_month_start(tstamp1)
11 print(f'Timestamp at month start :{res1}')
1 Timestamp at month start :True
2 Timestamp at month start :False
1 import pandas as pd
2
3 tstamp = pd.Timestamp(2023, 3, 1, 12, 35)
4 print('The timestamp object :', tstamp)
5
6 offset = pd.tseries.offsets.QuarterEnd(normalize = True)
7 res = offset.is_month_start(tstamp)
8 print(f'Timestamp at month start :{res}')
1 The timestamp object : 2023-03-01 12:35:00
2 Timestamp at month start :True
1 import pandas as pd
2
3 tstamp1 = pd.Timestamp(2024, 4, 1, 11, 45)
4 print('The timestamp object :', tstamp1)
5
6 offset1 = pd.tseries.offsets.QuarterEnd(n = 3, startingMonth = 4, normalize = True)
7 res1 = offset1.is_month_start(tstamp1)
8 print(f'Timestamp at month start :{res1}')
1 The timestamp object : 2024-04-01 11:45:00
2 Timestamp at month start :True