The Pandas tseries offsets CustomBusinessMonthBegin property m_offset used to retrieve the month offset from the CustomBusinessMonthBegin object. It returns a MonthBegin object.
1 CustomBusinessMonthBegin.m_offset
1 import pandas as pd
2
3 offset = pd.tseries.offsets.CustomBusinessMonthBegin(n = 2)
4 res = offset.m_offset
5 print(f'The month offset of CustomBusinessMonthBegin : {res}')
6 print(f'The month offset unit frequency is : {res.n}')
In the above example, a CustomBusinessMonthBegin object is created by passing a unit frequency. A resulting MonthBegin offset is assign to the variable that will be printed on console along with unit frequency.
1 The month offset of CustomBusinessMonthBegin : <MonthBegin>
2 The month offset unit frequency is : 1
Example 2
1 import pandas as pd
2
3 offset = pd.tseries.offsets.CustomBusinessMonthBegin(normalize = True)
4 res = offset.m_offset
5 print(f'The month offset of CustomBusinessMonthBegin : {res}')
6 print(f'The month offset unit frequency is : {res.n}')
In the above example, a CustomBusinessMonthBegin object is created without a unit frequency and normalize as true. A resulting MonthBegin offset is assign to the variable.
1 The month offset of CustomBusinessMonthBegin : <MonthBegin>
2 The month offset unit frequency is : 1
Example 3
1 import pandas as pd
2
3 offset1 = pd.tseries.offsets.CustomBusinessMonthBegin(n = 3, normalize = True)
4 res1 = offset1.m_offset
5 print(f'The month offset of CustomBusinessMonthBegin : {res1}')
6 print(f'The month offset unit frequency is : {res1.n}')
In the above example, a CustomBusinessMonthBegin object is created with a unit frequency and normalize as true. A resulting MonthBegin offset is assign to the variable.
1 The month offset of CustomBusinessMonthBegin : <MonthBegin>
2 The month offset unit frequency is : 1
Related options for your search