The Pandas tseries offsets Second property n used to retrieve a unit frequency value. It returns a number that represents the unit frequency. If not specified, the default value will be 1.
1 import pandas as pd
2
3 offset = pd.tseries.offsets.Second()
4 res = offset.n
5 print(f'The Second object unit frequency : {res}')
6
7 offset1 = pd.tseries.offsets.Second(n = 4)
8 res1 = offset1.n
9 print(f'The Second object unit frequency : {res1}')
In the above example, a Second objects are created with and without a unit frequency. A n property is access that returns a number that represents the number of Second(s) of an offset. The result is assign to the variable that will be printed on console.
1 The Second object unit frequency : 1
2 The Second object unit frequency : 4
Example 2
1 import pandas as pd
2
3 offset = pd.tseries.offsets.Second(n = 1)
4 res = offset.n
5 print(f'The Second object unit frequency : {res}')
In the above example, a Second objects are created with a unit frequency as 1. A n property is access that returns a number that represents the number of Second(s) of an offset.
1 The Second object unit frequency : 1
Example 3
1 import pandas as pd
2
3 offset1 = pd.tseries.offsets.Second(n = 3)
4 res1 = offset1.n
5 print(f'The Second object unit frequency : {res1}')
In the above example, a Second objects are created with a unit frequency as 3. A n property is access that returns a number that represents the number of Second(s) of an offset.
1 The Second object unit frequency : 3
Related options for your search