calendar

calendar

Exchange sessions, closures, and market-time operations.

Functions

Name Description
non_trading_days_after Count closed calendar dates after each exchange session.

non_trading_days_after

calendar.non_trading_days_after(dates, exchange)

Count closed calendar dates after each exchange session.

An early close is still a trading session. For example, a Friday early close followed by a Monday session has two non-trading days after it.

Parameters

Name Type Description Default
dates pd.Series Session dates. Time components are ignored and the index is preserved. required
exchange str ISO 10383 market identifier code, such as "XNYS" or "XSTO". required

Returns

Name Type Description
pd.Series Integer Series named non_trading_days_after.

Raises

Name Type Description
TypeError If dates is not a Series.
ValueError If the exchange is unknown or a value is missing or is not an exchange session.
Back to top