The pandas.tseries.offsets.CustomBusinessDay.isAnchored is a property of the CustomBusinessDay class, which is part of the pandas library's time series tools. This property helps you determine if an offset is anchored.
To understand "anchored", consider the frequency string "5D" versus "D". While both represent days, "5D" would represent a frequency of 5 days, whereas "D" represents a single day. In this context, "D" is considered anchored, as it refers to a fixed size of 1 unit, whereas "5D" is not anchored since it refers to multiple units.
The isAnchored property will return True for anchored offsets and False for unanchored ones.
Let's see an example:
Set Up the Environment:
First, make sure you have pandas installed:
pip install pandas
Example:
import pandas as pd # Create a CustomBusinessDay offset offset1 = pd.tseries.offsets.CustomBusinessDay() offset2 = pd.tseries.offsets.CustomBusinessDay(n=5) # Check if the offsets are anchored print(offset1.isAnchored) # True print(offset2.isAnchored) # False
Here's a breakdown:
CustomBusinessDay offsets: offset1 and offset2.CustomBusinessDay is 1 day (equivalent to "D"), so offset1.isAnchored returns True.offset2, we specified n=5, making it equivalent to "5D". Thus, offset2.isAnchored returns False.The isAnchored property is useful when you want to determine if an offset represents a fixed size of 1 unit.
virtual-environment delicious-api pyqtgraph rspec-rails kiosk-mode proxy-classes quartz post signalr-hub sharepoint-2013